BeaconPacket extends NetworkPacket { public final int getBattery() { return Byte.toUnsignedInt(getPayloadAt(BATT_INDEX)); } BeaconPacket(final byte[] data);  BeaconPacket(final int[] data);  BeaconPacket(final NetworkPacket data);  BeaconPacket(final int net, final NodeAddress src,
            final NodeAddress sink,
            final int distance, final int battery); final int getDistance(); final BeaconPacket setDistance(final byte value); final int getBattery(); final BeaconPacket setBattery(final byte value); final BeaconPacket setSinkAddress(final NodeAddress addr); final NodeAddress getSinkAddress();  }
@Test public void testGetBattery() { BeaconPacket instance = new BeaconPacket(1, new NodeAddress("0.2"), new NodeAddress("0.0"), 1, 1); int expResult = 1; int result = instance.getBattery(); assertEquals(expResult, result); }