CassandraDependenciesJob { static String parseHosts(String contactPoints) { List<String> result = new ArrayList<>(); for (String contactPoint : contactPoints.split(",", -1)) { HostAndPort parsed = HostAndPort.fromString(contactPoint); result.add(parsed.getHostText()); } return Joiner.on(',').join(result); } CassandraDependenciesJob(Builder builder); static Builder builder(); void run();  }
@Test public void parseHosts_ignoresPortSection() { assertThat(parseHosts("1.1.1.1:9142")) .isEqualTo("1.1.1.1"); }
@Test public void parseHosts_commaDelimits() { assertThat(parseHosts("1.1.1.1:9143,2.2.2.2:9143")) .isEqualTo("1.1.1.1,2.2.2.2"); }