@Test(timeOut = 1000)
public void testGetGHRepositories() throws Exception {

    Multimap<String, String> parentToPath = HashMultimap.create();
    parentToPath.put("test1", "test");
    parentToPath.put("test2", "correct");
    parentToPath.put("test3", "test");
    parentToPath.put("test4", "test");
    GHMyself currentUser = mock(GHMyself.class);
    PagedIterable<GHRepository> listOfRepos = mock(PagedIterable.class);
    GHRepository repo1 = mock(GHRepository.class);
    when(repo1.getName()).thenReturn("test1");
    GHRepository repo2 = mock(GHRepository.class);
    when(repo2.getName()).thenReturn("test2");
    GHRepository repo3 = mock(GHRepository.class);
    when(repo3.getName()).thenReturn("test3");
    GHRepository repo4 = mock(GHRepository.class);
    when(repo4.getName()).thenReturn("test4");
    PagedIterator<GHRepository> listOfReposIterator = mock(PagedIterator.class);
    when(listOfReposIterator.hasNext()).thenReturn(true, true, true, true, false);
    /* Uncomment below and check if it times out. */
      Mockito.when(listOfReposIterator.hasNext()).thenReturn(true, true, true, false, false);
    when(listOfReposIterator.next()).thenReturn(repo1, repo2, repo3, repo4, null);
    when(listOfRepos.iterator()).thenReturn(listOfReposIterator);
    when(currentUser.listRepositories(100, GHMyself.RepositoryListFilter.OWNER)).thenReturn(listOfRepos);
    GitHub github = mock(GitHub.class);
    GitHubUtil gitHubUtil = new GitHubUtil(github);
    List<GHRepository> actualList = gitHubUtil.getGHRepositories(parentToPath, currentUser);
    List<GHRepository> expectedList = new ArrayList<>();
    expectedList.add(repo1);
    expectedList.add(repo2);
    expectedList.add(repo3);
    expectedList.add(repo4);
    assertEquals(expectedList.size(), actualList.size());
    assertTrue(actualList.containsAll(expectedList));
    assertTrue(expectedList.containsAll(actualList));
}