ReportPacket extends BeaconPacket { public final ReportPacket setNeighbors(final int value) { if (value <= MAX_NEIG) { setPayloadAt((byte) value, NEIGH_INDEX); setPayloadSize((byte) (NEIGH_SIZE + value * NEIGH_SIZE)); } else { throw new IllegalArgumentException("Too many neighbors"); } return this; } ReportPacket(final byte[] data);  ReportPacket(final int net, final NodeAddress src,
            final NodeAddress dst,
            final int distance,
            final int battery);  ReportPacket(final int[] data);  ReportPacket(final NetworkPacket data); final int getNeigborsSize(); final ReportPacket setNeighbors(final int value); final NodeAddress getNeighborAddress(final int i); final ReportPacket setNeighborAddressAt(final NodeAddress addr,
            final int i); final int getLinkQuality(final int i); final ReportPacket setLinkQualityAt(final byte value, final int i); final HashMap<NodeAddress, Byte> getNeighbors(); final ReportPacket setNeighbors(
            final HashMap<NodeAddress, Byte> map);  }
@Test public void testToByteArray() { ReportPacket instance = new ReportPacket(1, new NodeAddress("0.2"), new NodeAddress("0.0"), 2, 1); HashMap<NodeAddress, Byte> map = new HashMap<>(); map.put(new NodeAddress("0.3"), (byte) 1); map.put(new NodeAddress("0.4"), (byte) 2); instance.setNeighbors(map); String expResult = "[1, 19, 0, 0, 0, 2, 2, 100, 0, 0, 2, 1, 2, 0," + " 3, 1, 0, 4, 2]"; String result = Arrays.toString(instance.toByteArray()); assertEquals(expResult, result); }