@Test
public void testGetTemperature() throws Exception {

    final DetectorTemperatureProvider provider = getDetectorTemperatureProviderForTesting();
    final long secondsSince1981 = 333849750;
    final long milliSecondsSince1981 = secondsSince1981 * 1000;
    final long milliSecondsSince1970 = milliSecondsSince1981 + TimeUtil.MILLIS_1981;
    final Date firstDate = new Date(milliSecondsSince1970);
    final Date secondDate = new Date(milliSecondsSince1970 + 300000);
    final Date thirdDate = new Date(milliSecondsSince1970 + 600000);
    final Date betweenThirdAndFourthDateLow = new Date(milliSecondsSince1970 + 749999);
    final Date betweenThirdAndFourthDateHigh = new Date(milliSecondsSince1970 + 750000);
    assertEquals(257.02, provider.getDetectorTemperature(firstDate), 0.001);
    assertEquals(256.95, provider.getDetectorTemperature(secondDate), 0.001);
    assertEquals(256.36, provider.getDetectorTemperature(thirdDate), 0.001);
    assertEquals(256.36, provider.getDetectorTemperature(betweenThirdAndFourthDateLow), 0.001);
    assertEquals(256.13, provider.getDetectorTemperature(betweenThirdAndFourthDateHigh), 0.001);
}