### Question:
Transformers { static MessageBody inputToQueryMessage(JsonElement payload) { Set<String> addresses = ImmutableSet.of(); if(payload != null) { QueryPayload query = GSON.fromJson(payload, QueryPayload.class); addresses = devicesToAddresses(query.devicesAsBeans()); } return GoogleService.QueryRequest.builder() .withAddresses(addresses) .build(); } 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 testInputToQueryMessage() { assertMessageBody( GoogleService.QueryRequest.builder().withAddresses(ImmutableSet.of()).build(), Transformers.inputToQueryMessage(null) ); String addr = Address.platformDriverAddress(IrisUUID.randomUUID()).getRepresentation(); QueryPayload payload = new QueryPayload(); payload.setDevices(ImmutableList.of( ImmutableMap.of("id", addr) )); assertMessageBody( GoogleService.QueryRequest.builder().withAddresses(ImmutableSet.of(addr)).build(), Transformers.inputToQueryMessage(Transformers.GSON.toJsonTree(payload, QueryPayload.class)) ); }