### Question:
HostsType { public static HostsType guessHighAvailability(LinkedHashSet<String> hosts) { if (hosts.isEmpty()) { throw new IllegalArgumentException("Cannot guess HA, empty hosts."); } String master = hosts.iterator().next(); List<String> secondaries = hosts.stream().skip(1).collect(toList()); return new HostsType(singletonList(new HighAvailabilityHosts(master, secondaries)), hosts); } private  HostsType(List<HighAvailabilityHosts> highAvailabilityHosts, LinkedHashSet<String> hosts); boolean hasMasters(); List<HighAvailabilityHosts> getHighAvailabilityHosts(); void arrangeHostSecondariesFirst(); boolean hasMastersAndSecondaries(); static HostsType from(String master, String secondary, LinkedHashSet<String> hosts); static HostsType highAvailability(String master, String secondary, LinkedHashSet<String> hosts); static HostsType guessHighAvailability(LinkedHashSet<String> hosts); static HostsType federated(List<HighAvailabilityHosts> highAvailabilityHosts, LinkedHashSet<String> hosts); static HostsType normal(LinkedHashSet<String> hosts); static HostsType normal(String... hosts); static HostsType single(String host); static HostsType healthy(Cluster cluster); LinkedHashSet<String> getMasters(); LinkedHashSet<String> getSecondaries(); Set<String> getHosts(); void setHosts(LinkedHashSet<String> hosts); public List<ServiceComponentHost> unhealthy; }### Answer:
@Test(expected = IllegalArgumentException.class) public void testGuessMasterFromEmptyList() { HostsType.guessHighAvailability(new LinkedHashSet<>(emptySet())); }