FlowUtils implements AutoCloseable { private IpPrefix convertIpAddressToIpPrefix(IpAddress ipAddress) { return new IpPrefix(new Ipv4Prefix(ipAddress.getIpv4Address().getValue() + "/32")); } FlowUtils(DataBroker dataBroker,
                     PacketProcessingService packetProcessingService,
                     PhyConfigLoader phyConfigLoader); void init(List<PhysicalNode> physicalNodes); void handleArp(PacketReceived packetReceived, NodeConnectorRef ingress); @Override void close(); void assignMPLSLabelForPPath(PhysicalPath physicalPath,
                  List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.physical.network.rev151010.physical.network.physical.links.PhysicalLink> physicalLinksList);  }
@Test public void testConvertIpAddressToIpPrefix() throws Exception{ Class<FlowUtils> class1 = FlowUtils.class; Method method = class1.getDeclaredMethod("convertIpAddressToIpPrefix", new Class[]{IpAddress.class}); method.setAccessible(true); IpAddress ipAddress = mock(IpAddress.class); Ipv4Address ipv4Address = mock(Ipv4Address.class); IpPrefix result; when(ipAddress.getIpv4Address()).thenReturn(ipv4Address); when(ipv4Address.getValue()).thenReturn(new String("192.168.1.1")); result = (IpPrefix)method.invoke(flowUtils,ipAddress); Assert.assertTrue(result != null); }