### Question:
BlacklistItemValidator implements ResourceValidator<BlacklistItem> { @Override public ValidatorResult validate(BlacklistItem blitem, Object httpRequestType) { ValidatorResult result = validator.validate(blitem, httpRequestType); return ValidatorUtilities.removeEmptyMessages(result); } BlacklistItemValidator(); @Override ValidatorResult validate(BlacklistItem blitem, Object httpRequestType); @Override Validator<BlacklistItem> getValidator();  }### Answer:
@Test public void shouldRejectVersionMisMatchIPv4() { bli.setIpVersion(IpVersion.IPV6); bli.setCidrBlock("192.168.3.51/24"); ValidatorResult result = bv.validate(bli, POST); assertFalse(resultMessage(result, POST), result.passedValidation()); }
@Test public void shouldRejectVersionMisMatchIPv6() { bli.setIpVersion(IpVersion.IPV6); bli.setCidrBlock("192.168.3.51/24"); ValidatorResult result = bv.validate(bli, POST); assertFalse(resultMessage(result, POST), result.passedValidation()); }
@Test public void shouldRejectIPv6String() { bli.setIpVersion(IpVersion.IPV6); bli.setCidrBlock("::"); ValidatorResult result = bv.validate(bli, POST); assertFalse(resultMessage(result, POST), result.passedValidation()); }
@Test public void shouldRejectIPv4String() { bli.setIpVersion(IpVersion.IPV6); bli.setCidrBlock("192.168.3.54"); ValidatorResult result = bv.validate(bli, POST); assertFalse(resultMessage(result, POST), result.passedValidation()); }
@Test public void shouldaCeptIPv4Cidr() { bli.setIpVersion(IpVersion.IPV4); bli.setCidrBlock("192.168.3.54/24"); ValidatorResult result = bv.validate(bli, POST); assertTrue(resultMessage(result, POST), result.passedValidation()); }
@Test public void shouldaCeptIPv6Cidr() { bli.setIpVersion(IpVersion.IPV6); bli.setCidrBlock("::/64"); ValidatorResult result = bv.validate(bli, POST); assertTrue(resultMessage(result, POST), result.passedValidation()); }