void () { MavenRemoteRepository remote1 = new MavenRemoteRepository("id1", "name", "http://foo/bar", null, null, null); MavenRemoteRepository remote2 = new MavenRemoteRepository("id2", "name", " http://foo\\bar\\\\ ", null, null, null); MavenRemoteRepository remote3 = new MavenRemoteRepository("id3", "name", "http://foo\\bar\\baz", null, null, null); MavenRemoteRepository remote4 = new MavenRemoteRepository("id4", "name", "http://foo/bar", null, null, null); MavenRemoteRepository remote5 = new MavenRemoteRepository("id4", "name", "http://foo/baz", null, null, null); assertEquals(1, MavenIndexUtils.groupRemoteRepositoriesByUrl(Collections.singleton(remote1)).size()); assertEquals(1, MavenIndexUtils.groupRemoteRepositoriesByUrl(asList(remote1, remote2)).size()); assertEquals(2, MavenIndexUtils.groupRemoteRepositoriesByUrl(asList(remote1, remote2, remote3)).size()); assertEquals(2, MavenIndexUtils.groupRemoteRepositoriesByUrl(asList(remote1, remote2, remote3, remote4)).size()); assertEquals(3, MavenIndexUtils.groupRemoteRepositoriesByUrl(asList(remote1, remote2, remote3, remote4, remote5)).size()); }