FlowUtils implements AutoCloseable { private MacAddress convertByteArray6ToMacAddress(byte[] byteArray) { return new MacAddress(HexEncode.bytesToHexStringFormat(byteArray)); } 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 testConvertByteArray6ToMacAddress() throws Exception{ Class<FlowUtils> class1 = FlowUtils.class; Method method = class1.getDeclaredMethod("convertByteArray6ToMacAddress",new Class[]{byte[].class}); method.setAccessible(true); Method method1 = class1.getDeclaredMethod("convertMacAddressToByteArray6", new Class[]{MacAddress.class}); method1.setAccessible(true); MacAddress result; MacAddress macAddress = mock(MacAddress.class); byte[] byteArray; when(macAddress.getValue()).thenReturn(new String("2001:da8:215:3f0:847a:4267:b2a3:892f")); byteArray = (byte[])method1.invoke(flowUtils, macAddress); result = (MacAddress)method.invoke(flowUtils,byteArray); Assert.assertTrue(result != null); }