### Question:
XBeePacketsQueue { private boolean ipv6AddressesMatch(XBeePacket xbeePacket, Inet6Address ipv6Address) { if (xbeePacket == null || ipv6Address == null || !(xbeePacket instanceof XBeeAPIPacket)) return false; APIFrameType packetType = ((XBeeAPIPacket)xbeePacket).getFrameType(); switch (packetType) { case RX_IPV6: if (((RXIPv6Packet)xbeePacket).getSourceAddress().equals(ipv6Address)) return true; break; default: return false; } return false; } XBeePacketsQueue();  XBeePacketsQueue(int maxLength); void addPacket(XBeePacket xbeePacket); void clearQueue(); XBeePacket getFirstPacket(int timeout); XBeePacket getFirstPacketFrom(RemoteXBeeDevice remoteXBeeDevice, int timeout); XBeePacket getFirstDataPacket(int timeout); XBeePacket getFirstDataPacketFrom(RemoteXBeeDevice remoteXBeeDevice, int timeout); XBeePacket getFirstExplicitDataPacket(int timeout); XBeePacket getFirstExplicitDataPacketFrom(RemoteXBeeDevice remoteXBeeDevice, int timeout); XBeePacket getFirstIPDataPacket(int timeout); XBeePacket getFirstIPv6DataPacket(int timeout); XBeePacket getFirstIPDataPacketFrom(Inet4Address ipAddress, int timeout); XBeePacket getFirstIPv6DataPacketFrom(Inet6Address ipv6Address, int timeout); int getMaxSize(); int getCurrentSize(); static final int DEFAULT_MAX_LENGTH; }### Answer:
@Test public void testIPv6AddressesMatch() throws Exception { ArrayList<XBeePacket> ipPackets = new ArrayList<XBeePacket>(); ipPackets.add(mockedRxIPv6Packet); XBeePacketsQueue xbeePacketsQueue = PowerMockito.spy(new XBeePacketsQueue()); Mockito.when(mockedRxIPv6Packet.getSourceAddress()).thenReturn(ipv6Address1); for (XBeePacket packet:ipPackets) assertTrue((Boolean)Whitebox.invokeMethod(xbeePacketsQueue, METHOD_IPV6_ADDRESSES_MATCH, packet, ipv6Address1)); Mockito.when(mockedRxIPv6Packet.getSourceAddress()).thenReturn(ipv6Address2); for (XBeePacket packet:ipPackets) assertFalse((Boolean)Whitebox.invokeMethod(xbeePacketsQueue, METHOD_IPV6_ADDRESSES_MATCH, packet, ipv6Address1)); }