### Question:
Kick { boolean checkIfPublicIP(String crUrl, Properties properties) throws MalformedURLException { return !properties.isCheckPublicIp() || IPAddress.isPublic(new URL(crUrl).getHost()); }  static KickResponse kick(Unit unit, Properties properties);  }### Answer:
@Test public void testPublicIpCheckEnabled() throws MalformedURLException { Properties properties = new Properties( ConfigFactory.empty() .withValue("kick.check-public-ip", ConfigValueFactory.fromAnyRef(true))); String ip = "http: boolean isPublic = new Kick().checkIfPublicIP(ip, properties); assertFalse(isPublic); }
@Test public void testPublicIpCheckDisabled() throws MalformedURLException { Properties properties = new Properties( ConfigFactory.empty() .withValue("kick.check-public-ip", ConfigValueFactory.fromAnyRef(false))); String ip = "http: boolean isPublic = new Kick().checkIfPublicIP(ip, properties); assertTrue(isPublic); }