### Question:
ColorService { @GET @Path("/{id}") public Response getColor(@PathParam("id") String id) { Response response = null; UUID uuid = null; ColoredLamp lamp = null; logRequest("", id); response = ElisResponseBuilder.buildBadRequestResponse(); try { uuid = UUID.fromString(id); } catch (Exception e) { log(LogService.LOG_WARNING, "Bad UUID"); } if (userService != null && storage != null && uuid != null) { if (storage.objectExists(uuid)) { try { lamp = (ColoredLamp) storage.readData(uuid); ColorBean bean = new ColorBean(); bean.device = uuid; bean.color = toJsonHex(lamp.getColor()); response = ElisResponseBuilder.buildOKResponse(bean); } catch (StorageException | ClassCastException e) { log(LogService.LOG_INFO, "Tried to perform a getPowerstate on a non-power switch object: " + uuid); response = ElisResponseBuilder.buildMethodNotAllowedResponse(); } catch (ActuatorFailedException e) { log(LogService.LOG_WARNING, "Couldn't read device status from: " + uuid); response = ElisResponseBuilder.buildServiceUnavailableResponse(); } } else { response = ElisResponseBuilder.buildNotFoundResponse(); } } return response; } ColorService();  ColorService(UserService us, Storage storage, EndpointUtils utils); @GET @Path("/{id}") Response getColor(@PathParam("id") String id); @PUT @Path("/{id}") Response setColor(@PathParam("id") String id,
			ColorBean bean);  }### Answer:
@Test public void testGetColor() { final String deviceResponse = target("/color/" + DID + "/").request().get(String.class); EnvelopeBean envelope = gson.fromJson(deviceResponse, EnvelopeBean.class); ColorBean bean = gson.fromJson(gson.toJson(envelope.response), ColorBean.class); assertEquals(DID, bean.device); assertEquals(COLOR_IN_HEX, bean.color); }