### Question:
Transformers { static Optional<String> modelToGoogleType(Model m) { if(m == null) { return Optional.empty(); } if(m.supports(DeviceCapability.NAMESPACE)) { return devTypeHintToGoogleType(DeviceModel.getDevtypehint(m)); } if(m.supports(SceneCapability.NAMESPACE)) { return Optional.of(Constants.Type.SCENE); } return Optional.empty(); } 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 testModelToGoogleType() { assertEquals(Optional.empty(), Transformers.modelToGoogleType(null)); assertEquals(Optional.empty(), Transformers.modelToGoogleType(nonDevModel)); Model m = ModelFixtures.buildDeviceAttributes(SwitchCapability.NAMESPACE).toModel(); m.setAttribute(DeviceCapability.ATTR_DEVTYPEHINT, Constants.DeviceTypeHint.LIGHT); assertEquals(Constants.Type.LIGHT, Transformers.modelToGoogleType(m).get()); m = new SimpleModel(ModelFixtures.buildServiceAttributes(SceneCapability.NAMESPACE).create()); assertEquals(Constants.Type.SCENE, Transformers.modelToGoogleType(m).get()); }