@Test public void testAddServiceReposToOperatingSystemEntities_SimpleCase() {

  List<OperatingSystemEntity> operatingSystems = new ArrayList<>();
  for (String os: OPERATING_SYSTEMS) {
    RepositoryEntity repo1 = repoEntity("HDP", "HDP-2.3", "http://hdp.org/2.3");
    RepositoryEntity repo2 = repoEntity("HDP-UTILS", "HDP-UTILS-1.1.0", "http://hdp.org/utils/1.1.0");
    operatingSystems.add(osEntity(os, repo1, repo2));
  }
  ListMultimap<String, RepositoryInfo> serviceRepos = serviceRepos(ImmutableList.of("redhat5", "redhat6", "sles11"),
      "MSFT_R", "MSFT_R-8.1", "http://msft.r");
  RepoUtil.addServiceReposToOperatingSystemEntities(operatingSystems, serviceRepos);
  // Verify results. Service repos should be added only to redhat6 and sles11
  for (OperatingSystemEntity os: operatingSystems) {
    Assert.assertNotSame("Redhat5 should not be added as new operating system.", "redhat5", os.getOsType());
    Optional<RepositoryEntity> msft_r = findRepoEntityById(os.getRepositories(), "MSFT_R-8.1");
    Assert.assertTrue(
        String.format("Only redhat6 and sles11 should contain the service repo. os: %s, repo: %s", os.getOsType(), msft_r),
        findRepoEntityById(os.getRepositories(), "MSFT_R-8.1").isPresent() ==  ImmutableList.of("redhat6", "sles11").contains(os.getOsType())) ;
  }
}