### Question:
EsConfig { public static EsConfig from(String... hostsAddresses) { return new EsConfig(hostsAddresses); } private  EsConfig(@NonNull String[] hostsAddresses); static EsConfig from(String... hostsAddresses); List<URL> getHosts(); String[] getRawHosts();  }### Answer:
@Test(expected = NullPointerException.class) public void createConfigNullHostsTest() { EsConfig.from((String[]) null); }
@Test(expected = IllegalArgumentException.class) public void createConfigInvalidHostsTest() { EsConfig.from("wrong url"); thrown.expectMessage(CoreMatchers.containsString("is not a valid url")); }