### Question:
Transformers { static Map<String,Object> modelToTraitAttributes(Model m) { if(m != null) { if(m.supports(ColorTemperatureCapability.NAMESPACE)) { return ImmutableMap.of( Constants.Attributes.ColorTemperature.TEMPERATURE_MIN_K, ColorTemperatureModel.getMincolortemp(m, Constants.Defaults.COLOR_TEMPERATURE_MIN), Constants.Attributes.ColorTemperature.TEMPERATURE_MAX_K, ColorTemperatureModel.getMaxcolortemp(m, Constants.Defaults.COLOR_TEMPERATURE_MAX) ); } if(m.supports(ThermostatCapability.NAMESPACE)) { return ImmutableMap.of( Constants.Attributes.TemperatureSetting.UNIT, "F", Constants.Attributes.TemperatureSetting.MODES, StringUtils.join(thermostatSupportedModes(m), ',') ); } if(m.supports(SceneCapability.NAMESPACE)) { return ImmutableMap.of(Constants.Attributes.Scene.sceneReversible, false); } } return ImmutableMap.of(); } private  Transformers(); static Optional<GoogleDevice> modelToDevice(Model m, boolean whitelisted, @Nullable ProductCatalogEntry pm, boolean reportStateEnabled); static Map<String,Object> modelToStateMap(Model m, boolean hubOffline, boolean whitelisted, @Nullable ProductCatalogEntry pm); static Optional<MessageBody> commandToMessageBody(Model m, boolean hubOffline, String command, Map<String, Object> params, boolean whitelisted, @Nullable ProductCatalogEntry pm); static PlatformMessage requestToMessage(Request req, UUID placeId, String population, int ttl); static Response messageToResponse(PlatformMessage msg); static final Gson GSON; static final String PRODUCT_ID; static final String TYPE_HINT; }### Answer:
@Test public void testModelToTraitAttributes() { assertEquals(ImmutableMap.of(), Transformers.modelToTraitAttributes(null)); assertEquals(ImmutableMap.of(), Transformers.modelToTraitAttributes(unsupportedDev)); assertEquals(ImmutableMap.of( Constants.Attributes.ColorTemperature.TEMPERATURE_MIN_K, 2000, Constants.Attributes.ColorTemperature.TEMPERATURE_MAX_K, 6500 ), Transformers.modelToTraitAttributes(allCaps)); assertEquals(ImmutableMap.of( Constants.Attributes.TemperatureSetting.UNIT, "F", Constants.Attributes.TemperatureSetting.MODES, StringUtils.join(ImmutableList.of("off", "cool", "heat", "heatcool"), ',') ), Transformers.modelToTraitAttributes(thermo)); thermo.setAttribute(ThermostatCapability.ATTR_SUPPORTSAUTO, false); assertEquals(ImmutableMap.of( Constants.Attributes.TemperatureSetting.UNIT, "F", Constants.Attributes.TemperatureSetting.MODES, StringUtils.join(ImmutableList.of("off", "cool", "heat"), ',') ), Transformers.modelToTraitAttributes(thermo)); }