@Test public void testGetServiceRepos() {

  List<RepositoryInfo> vdfRepos = Lists.newArrayList(repoInfo("HDP", "HDP-2.3", "redhat6"),
      repoInfo("HDP-UTILS", "HDP-UTILS-1.1.0.20", "redhat6"),
      repoInfo("HDP", "HDP-2.3", "redhat5"),
      repoInfo("HDP-UTILS", "HDP-UTILS-1.1.0.20", "redhat5"));
  List<RepositoryInfo> stackRepos = Lists.newArrayList(vdfRepos);
  stackRepos.add(repoInfo("MSFT_R", "MSFT_R-8.1", "redhat6"));
  ImmutableListMultimap<String, RepositoryInfo> stackReposByOs =
      Multimaps.index(stackRepos, RepositoryInfo.GET_OSTYPE_FUNCTION);
  List<RepositoryInfo> serviceRepos = RepoUtil.getServiceRepos(vdfRepos, stackReposByOs);
  Assert.assertEquals("Expected 1 service repo", 1, serviceRepos.size());
  Assert.assertEquals("Expected MSFT_R service repo", "MSFT_R", serviceRepos.get(0).getRepoName());
}