public static InetAddressValidator getInstance() {
return VALIDATOR;
}
@Override
public boolean isValid(String inetAddress) {
<BUG>return isValidInet4Address(inetAddress);
}</BUG>
public boolean isValidInet4Address(String inet4Address) {
String[] groups = ipv4Validator.match(inet4Address);
<BUG>if (groups == null) return false;

for (int i = 0; i <= 3; i++) {
String ipSegment = groups[i];
</BUG>
if (ipSegment == null || ipSegment.isEmpty()) {

public static InetAddressValidator getInstance() {
return VALIDATOR;
}
@Override
public boolean isValid(String inetAddress) {
return isValidInet4Address(inetAddress) || isValidInet6Address(inetAddress);
}
public boolean isValidInet4Address(String inet4Address) {
String[] groups = ipv4Validator.match(inet4Address);
if (groups == null) {
