### Question:
VirtualDataSourceResourceConverter extends ResourceConverterImpl<VirtualReportDataSource, ClientVirtualDataSource> { @Override protected ClientVirtualDataSource resourceSpecificFieldsToClient(ClientVirtualDataSource client, VirtualReportDataSource serverObject, ToClientConversionOptions options) { final Map<String,ResourceReference> dataSourceUriMap = serverObject.getDataSourceUriMap(); List<ClientSubDataSourceReference> subDataSources = null; if(dataSourceUriMap != null && !dataSourceUriMap.isEmpty()){ subDataSources = new ArrayList<ClientSubDataSourceReference>(dataSourceUriMap.size()); for(String currentId : dataSourceUriMap.keySet()){ final ClientSubDataSourceReference currentReference = new ClientSubDataSourceReference(); currentReference.setId(currentId); currentReference.setUri(dataSourceUriMap.get(currentId).getReferenceURI()); subDataSources.add(currentReference); } } client.setSubDataSources(subDataSources); return client; }    }### Answer:
@Test public void resourceSpecificFieldsToClient(){ final String expectedId1 = "testId1"; final String expectedId2 = "testId2"; final String expectedUri1 = "testUri1"; final String expectedUri2 = "testUri2"; ClientVirtualDataSource clientObject = new ClientVirtualDataSource(); VirtualReportDataSource serverObject = new VirtualReportDataSourceImpl(); final Map<String,ResourceReference> dataSourceUriMap = new HashMap<String, ResourceReference>(); dataSourceUriMap.put(expectedId1, new ResourceReference(expectedUri1)); dataSourceUriMap.put(expectedId2, new ResourceReference(expectedUri2)); serverObject.setDataSourceUriMap(dataSourceUriMap); final ClientVirtualDataSource result = converter.resourceSpecificFieldsToClient(clientObject, serverObject, null); assertSame(result, clientObject); final List<ClientSubDataSourceReference> subDataSources = result.getSubDataSources(); assertNotNull(subDataSources); assertEquals(subDataSources.size(), 2); for(ClientSubDataSourceReference currentReference : subDataSources){ if(expectedId1.equals(currentReference.getId())){ assertEquals(expectedUri1, currentReference.getUri()); } else if(expectedId2.equals(currentReference.getId())){ assertEquals(expectedUri2, currentReference.getUri()); } else { assertTrue(false); } } }