Temperature { public static Temperature fromKelvin(double value, TemperatureType type) { return new Temperature(round(type.fromKelvin(value)), type); } @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 testFromKelvin() { Temperature celsiusL = Temperature.fromKelvin(273.15, TemperatureType.CELSIUS); Temperature celsiusM = Temperature.fromKelvin(300, TemperatureType.CELSIUS); Temperature celsiusH = Temperature.fromKelvin(773.15, TemperatureType.CELSIUS); Temperature fahrenheitL = Temperature.fromKelvin(273.15, TemperatureType.FAHRENHEIT); Temperature fahrenheitM = Temperature.fromKelvin(300, TemperatureType.FAHRENHEIT); Temperature fahrenheitH = Temperature.fromKelvin(773.15, TemperatureType.FAHRENHEIT); Assert.assertEquals(0, celsiusL.getValue(), DELTA); Assert.assertEquals(26.85, celsiusM.getValue(), DELTA); Assert.assertEquals(500, celsiusH.getValue(), DELTA); Assert.assertEquals(32, fahrenheitL.getValue(), DELTA); Assert.assertEquals(80.33, fahrenheitM.getValue(), DELTA); Assert.assertEquals(932, fahrenheitH.getValue(), DELTA); }