@Test(expected = IllegalArgumentException.class) public void invalidCidrBlock() throws Exception { underTest.validate(singletonList("cidrBlock")); }
public void validate(List<String> cidrBlocks) { cidrBlocks.forEach(cidrBlock -> { try { new SubnetUtils(cidrBlock); } catch (IllegalArgumentException e) { throw new IllegalArgumentException( String.format("%s is not a valid CIDR Block: %s", cidrBlock, e.getMessage())); } }); }
CidrBlockValidator { public void validate(List<String> cidrBlocks) { cidrBlocks.forEach(cidrBlock -> { try { new SubnetUtils(cidrBlock); } catch (IllegalArgumentException e) { throw new IllegalArgumentException( String.format("%s is not a valid CIDR Block: %s", cidrBlock, e.getMessage())); } }); } }
CidrBlockValidator { public void validate(List<String> cidrBlocks) { cidrBlocks.forEach(cidrBlock -> { try { new SubnetUtils(cidrBlock); } catch (IllegalArgumentException e) { throw new IllegalArgumentException( String.format("%s is not a valid CIDR Block: %s", cidrBlock, e.getMessage())); } }); }  }
CidrBlockValidator { public void validate(List<String> cidrBlocks) { cidrBlocks.forEach(cidrBlock -> { try { new SubnetUtils(cidrBlock); } catch (IllegalArgumentException e) { throw new IllegalArgumentException( String.format("%s is not a valid CIDR Block: %s", cidrBlock, e.getMessage())); } }); }  void validate(List<String> cidrBlocks); }
CidrBlockValidator { public void validate(List<String> cidrBlocks) { cidrBlocks.forEach(cidrBlock -> { try { new SubnetUtils(cidrBlock); } catch (IllegalArgumentException e) { throw new IllegalArgumentException( String.format("%s is not a valid CIDR Block: %s", cidrBlock, e.getMessage())); } }); }  void validate(List<String> cidrBlocks);  }