### Question:
VrfValidation { protected void aaiSubnetValidation(org.onap.aai.domain.yang.L3Network aaiLocalNetwork) throws VrfBondingServiceException { if (aaiLocalNetwork.getSubnets() == null || aaiLocalNetwork.getSubnets().getSubnet() == null) { throw new VrfBondingServiceException("LocalNetwork: " + aaiLocalNetwork.getNetworkId() + " has no subnets"); } else if (aaiLocalNetwork.getSubnets().getSubnet().size() == 1 && !aaiLocalNetwork.getSubnets().getSubnet().get(0).getIpVersion().equalsIgnoreCase("4")) { throw new VrfBondingServiceException("LocalNetwork: " + aaiLocalNetwork.getNetworkId() + " has 1 subnet but the Ip version of subnet is : " + aaiLocalNetwork.getSubnets().getSubnet().get(0).getIpVersion() + " and is not 4"); } else if (aaiLocalNetwork.getSubnets().getSubnet().size() == 2 && !ipVersionValidation(aaiLocalNetwork.getSubnets().getSubnet().get(0).getIpVersion(), aaiLocalNetwork.getSubnets().getSubnet().get(1).getIpVersion())) { throw new VrfBondingServiceException("LocalNetwork: " + aaiLocalNetwork.getNetworkId() + " has 2 subnets but the combination of the Ip versions for the subnets did not match the ip version of one of them to be 4 and one to be 6"); } else if (aaiLocalNetwork.getSubnets().getSubnet().isEmpty() || aaiLocalNetwork.getSubnets().getSubnet().size() > 2) { throw new VrfBondingServiceException("LocalNetwork: " + aaiLocalNetwork.getNetworkId() + " either has no subnets or more than 2 subnets"); } }  void setBbInputSetupUtils(BBInputSetupUtils bbInputSetupUtils);  }### Answer:
@Test public void testAaiSubnetValidation() throws VrfBondingServiceException { org.onap.aai.domain.yang.L3Network aaiLocalNetwork = new org.onap.aai.domain.yang.L3Network(); aaiLocalNetwork.setNetworkId("myNetworkID"); aaiLocalNetwork.setSubnets(new Subnets()); aaiLocalNetwork.getSubnets().getSubnet().add(new Subnet()); aaiLocalNetwork.getSubnets().getSubnet().get(0).setIpVersion("4"); ExpectedException.none(); vrfValidation.aaiSubnetValidation(aaiLocalNetwork); aaiLocalNetwork.getSubnets().getSubnet().add(new Subnet()); aaiLocalNetwork.getSubnets().getSubnet().get(1).setIpVersion("6"); ExpectedException.none(); vrfValidation.aaiSubnetValidation(aaiLocalNetwork); aaiLocalNetwork.setSubnets(null); exceptionRule.expect(VrfBondingServiceException.class); exceptionRule.expectMessage("LocalNetwork: myNetworkID has no subnets"); vrfValidation.aaiSubnetValidation(aaiLocalNetwork); }