IPv4AccessControl { boolean isLocal(InetAddress address) { return address.isLoopbackAddress() || address.isSiteLocalAddress(); }  void validate(String clientIP); public IPv4Ranges allow; public IPv4Ranges deny; }
@Test void isLocal() throws UnknownHostException { assertThat(accessControl.isLocal(InetAddress.getByName("127.0.0.1"))).isTrue(); assertThat(accessControl.isLocal(InetAddress.getByName("192.168.0.1"))).isTrue(); assertThat(accessControl.isLocal(InetAddress.getByName("10.0.0.1"))).isTrue(); assertThat(accessControl.isLocal(InetAddress.getByName("::1"))).isTrue(); assertThat(accessControl.isLocal(InetAddress.getByName("24.0.0.1"))).isFalse(); }