Temperature { @JsonIgnore public double getValueInKelvin() { double kelvin = type.toKelvin(value); return round(kelvin); } @JsonCreator  Temperature(
		@JsonProperty("value") double value,
		@JsonProperty("type") TemperatureType type); static Temperature fromKelvin(double value, TemperatureType type); double getValue(); @JsonIgnore double getValueInKelvin(); TemperatureType getType(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testGetValueInKelvin() { Temperature celsiusL = new Temperature(0, TemperatureType.CELSIUS); Temperature celsiusM = new Temperature(26.85, TemperatureType.CELSIUS); Temperature celsiusH = new Temperature(500, TemperatureType.CELSIUS); Temperature fahrenheitL = new Temperature(32, TemperatureType.FAHRENHEIT); Temperature fahrenheitM = new Temperature(80.33, TemperatureType.FAHRENHEIT); Temperature fahrenheitH = new Temperature(932, TemperatureType.FAHRENHEIT); Assert.assertEquals(273.15, celsiusL.getValueInKelvin(), DELTA); Assert.assertEquals(300, celsiusM.getValueInKelvin(), DELTA); Assert.assertEquals(773.15, celsiusH.getValueInKelvin(), DELTA); Assert.assertEquals(273.15, fahrenheitL.getValueInKelvin(), DELTA); Assert.assertEquals(300, fahrenheitM.getValueInKelvin(), DELTA); Assert.assertEquals(773.15, fahrenheitH.getValueInKelvin(), DELTA); }