### Question:
AppendableTemperature extends SimpleTemperature { public void append(Temperature temperature) { if (getLow() == Temperature.UNKNOWN) { setLow(temperature.getLow(), temperature.getTemperatureUnit()); } else { setLow(Math.min( getLow(), convertValue(temperature.getLow(), temperature.getTemperatureUnit())), getTemperatureUnit()); } if (getHigh() == Temperature.UNKNOWN) { setHigh(temperature.getHigh(), temperature.getTemperatureUnit()); } else { setHigh(Math.max( getHigh(), convertValue(temperature.getHigh(), temperature.getTemperatureUnit())), getTemperatureUnit()); } } AppendableTemperature(TemperatureUnit unit); void append(Temperature temperature);  }### Answer:
@Test public void testAppendLowTemperature() { AppendableTemperature temperature = new AppendableTemperature(TemperatureUnit.C); assertEquals(Temperature.UNKNOWN, temperature.getLow()); SimpleTemperature append1 = new SimpleTemperature(TemperatureUnit.C); append1.setLow(-5, TemperatureUnit.C); temperature.append(append1); assertEquals(-5, temperature.getLow()); SimpleTemperature append2 = new SimpleTemperature(TemperatureUnit.C); append2.setLow(-10, TemperatureUnit.C); temperature.append(append2); assertEquals(-10, temperature.getLow()); SimpleTemperature append3 = new SimpleTemperature(TemperatureUnit.C); append3.setLow(-3, TemperatureUnit.C); temperature.append(append3); assertEquals(-10, temperature.getLow()); }
@Test public void testAppendHighTemperature() { AppendableTemperature temperature = new AppendableTemperature(TemperatureUnit.C); assertEquals(Temperature.UNKNOWN, temperature.getHigh()); SimpleTemperature append1 = new SimpleTemperature(TemperatureUnit.C); append1.setHigh(5, TemperatureUnit.C); temperature.append(append1); assertEquals(5, temperature.getHigh()); SimpleTemperature append2 = new SimpleTemperature(TemperatureUnit.C); append2.setHigh(10, TemperatureUnit.C); temperature.append(append2); assertEquals(10, temperature.getHigh()); SimpleTemperature append3 = new SimpleTemperature(TemperatureUnit.C); append3.setHigh(3, TemperatureUnit.C); temperature.append(append3); assertEquals(10, temperature.getHigh()); }
@Test public void testAppendTemperatureConvert() { AppendableTemperature temperature = new AppendableTemperature(TemperatureUnit.C); assertEquals(Temperature.UNKNOWN, temperature.getLow()); SimpleTemperature append1 = new SimpleTemperature(TemperatureUnit.K); append1.setLow(273, TemperatureUnit.K); temperature.append(append1); assertEquals(0, temperature.getLow()); assertEquals(0, temperature.getHigh()); }