### Question:
Transformers { static Optional<GoogleDeviceName> modelToDeviceName(Model m) { if(m == null) { return Optional.empty(); } if(m.supports(DeviceCapability.NAMESPACE)) { return createDeviceName(DeviceModel.getName(m)); } if(m.supports(SceneCapability.NAMESPACE)) { return createDeviceName(SceneModel.getName(m)); } 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 testModelToDeviceName() { assertEquals(Optional.empty(), Transformers.modelToDeviceName(null)); assertEquals(Optional.empty(), Transformers.modelToDeviceName(nonDevModel)); unsupportedDev.setAttribute(DeviceCapability.ATTR_NAME, "foobar"); assertDeviceName(devName, Transformers.modelToDeviceName(unsupportedDev).get()); Model m = new SimpleModel(ModelFixtures.buildServiceAttributes(SceneCapability.NAMESPACE).create()); m.setAttribute(SceneCapability.ATTR_NAME, "foobar"); assertDeviceName(devName, Transformers.modelToDeviceName(m).get()); }