NodeAddress implements Comparable<NodeAddress>, Serializable { public byte[] getArray() { return new byte[]{addr[0], addr[1]}; } NodeAddress(final int a);  NodeAddress(final byte[] a);  NodeAddress(final String a);  NodeAddress(final int addr0, final int addr1); @Override int compareTo(final NodeAddress other); @Override boolean equals(final Object obj); byte[] getArray(); byte getHigh(); byte getLow(); @Override int hashCode(); int intValue(); boolean isBroadcast(); Byte[] toByteArray(); @Override String toString(); static final NodeAddress BROADCAST_ADDR; }
@Test public void testGetArray() { NodeAddress instance = new NodeAddress("1.1"); byte[] expResult = new byte[]{(byte) 1, (byte) 1}; byte[] result = instance.getArray(); assertArrayEquals(expResult, result); }