### Question:
HubEventListener extends AbstractPlatformMessageListener implements PlatformService { @Override public Address getAddress() { return address; } @Inject  HubEventListener(
         PlatformMessageBus platformBus,
         @Named(PROP_THREADPOOL) Executor executor,
         HubDAO hubDao,
         HubRegistry hubRegistry,
         BeanAttributesTransformer<Hub> hubTransformer,
         Partitioner partitioner,
         DeviceDAO deviceDao,
         PlacePopulationCacheManager populationCacheMgr
   ); @Override Address getAddress(); @Override void handleMessage(PlatformMessage message); static final String PROP_THREADPOOL; }### Answer:
@Test public void testHubConnectedDeviceSync() throws Exception { hub.setLastDeviceAddRemove(UUID.randomUUID()); MessageBody body = createOnConnectedEvent(); hub.setLastDeviceAddRemove(UUID.randomUUID()); Device matchedDevice = createUniqueProtocolIdDevice(); Device unknownDevice = createUniqueProtocolIdDevice(); Device lostDevice = createUniqueProtocolIdDevice(); PlatformMessage connected = PlatformMessage.createBroadcast(body, Address.hubService(hubId, "hub")); expectGetPartition(connected); EasyMock.expect(mockHubDao.findById(hubId)).andReturn(hub); EasyMock.expect(mockDeviceDao.findByHubId(hubId)).andReturn(ImmutableList.<Device>of(matchedDevice,lostDevice)); replay(); listener.onMessage(connected); PlatformMessage message = assertMessagePutOnBus(GetKnownDevicesRequest.NAME,Address.hubService(hubId, "hub"),ImmutableMap.of()); List<String>knownDevices=ImmutableList.of(matchedDevice.getProtocolAddress(),unknownDevice.getProtocolAddress()); MessageBody getKnownDevicesResponse = GetKnownDevicesResponse.builder().withDevices(knownDevices).build(); PlatformMessage response = PlatformMessage.buildResponse(message, getKnownDevicesResponse).create(); listener.onMessage(response); assertMessagePutOnBus(LostDeviceRequest.NAME,Address.fromString(lostDevice.getAddress()),ImmutableMap.of()); verify(); }