### Question:
BuildPropertiesReader { public BuildProperties getFirstServiceBuildProperties() { readAllBuildProperties(); for(BuildProperties buildProperties : allBuildProperties) { if(buildProperties.isService()) { return buildProperties; } } return null; } BuildPropertiesReader(String buildPropertiesFile); BuildProperties getFirstServiceBuildProperties(); List<BuildProperties> getNonServiceBuildProperties(); List<BuildProperties> getAllBuildProperties(); void setResourceRetriever(ResourceRetriever resourcesRetriever);  }### Answer:
@Test(dataProvider = "ServicePropertiesCountProvider") public void testGetFirstServiceBuildProperties(final int SERVICE_PROPERTIES_COUNT) throws Exception { final int NON_SERVICE_PROPERTIES_COUNT = 10; generateResourceContents(SERVICE_PROPERTIES_COUNT, NON_SERVICE_PROPERTIES_COUNT); BuildProperties result = buildPropertiesReader.getFirstServiceBuildProperties(); if(SERVICE_PROPERTIES_COUNT > 0) { Assert.assertNotNull(result); assertAllPropertiesValid(Collections.singletonList(result)); } else { Assert.assertNull(result); } }