ServerList { public List<ServerSpec> getSpecs() { return specs; } ServerList(List<ServerSpec> specs);  ServerList(String serverSpec); String toSpecString(); ServerSpec getSpec(final String hostname); List<ServerSpec> getSpecs(); Collection<String> getHostnames(); static Predicate<ServerSpec> isUs(final String hostname); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); ServerList filterOutObservers();  }
@Test public void testSimple() { ServerList serverList = new ServerList("1:a"); Assert.assertEquals(serverList.getSpecs(), Arrays.asList(new ServerSpec("a", 1, STANDARD))); serverList = new ServerList("1:a,2:b"); Assert.assertEquals(serverList.getSpecs(), Arrays.asList(new ServerSpec("a", 1, STANDARD), new ServerSpec("b", 2, STANDARD))); serverList = new ServerList("2:b,1:a"); Assert.assertEquals(serverList.getSpecs(), Arrays.asList(new ServerSpec("b", 2, STANDARD), new ServerSpec("a", 1, STANDARD))); serverList = new ServerList("2:b,1:a"); Assert.assertNotEquals(serverList.getSpecs(), Arrays.asList(new ServerSpec("a", 1, STANDARD), new ServerSpec("b", 2, STANDARD))); }
@Test public void testEdges() { ServerList serverList = new ServerList("1:a,,,a,asfklasf,L:1x30,:*&*,$:$"); Assert.assertEquals(serverList.getSpecs(), Arrays.asList(new ServerSpec("a", 1, STANDARD))); serverList = new ServerList("1 :a , 2 : b \t\t, , : ,"); Assert.assertEquals(serverList.getSpecs(), Arrays.asList(new ServerSpec("a", 1, STANDARD), new ServerSpec("b", 2, STANDARD))); }