### Question:
CountryFilterService { public boolean isIPAllowed(String ipAddress) { return countryFilterConfigHolder.isEnabled() ? this.ip2Asn2Cc.checkIP(ipAddress) : true; }  boolean isIPAllowed(String ipAddress);  }### Answer:
@Test public void testIsIPAllowed_Correct_IP() { when(ip2Asn2Cc.checkIP(eq("1.2.3.4"))).thenReturn(true); boolean result = countryFilterService.isIPAllowed("1.2.3.4"); assertTrue(result); }
@Test public void testIsIPAllowed_Wrong_IP() { when(ip2Asn2Cc.checkIP(eq("1.2.3.4"))).thenReturn(false); boolean result = countryFilterService.isIPAllowed("1.2.3.4"); assertFalse(result); }
@Test public void testCountryFilter_Not_Enabled() { doReturn(false).when(countryFilterConfigHolder).isEnabled(); boolean result = countryFilterService.isIPAllowed("1.2.3.4"); assertTrue(result); }