### Question:
AllowedMechanisms { public byte[] toBinaryEncoding() { final int num = mechs.size(); final ByteBuffer bb = ByteBuffer.allocate(8 * num); bb.order(ByteOrder.LITTLE_ENDIAN); for (long mech : mechs) { bb.putLong(mech); } return bb.array(); } AllowedMechanisms(List<Long> mechs); static AllowedMechanisms parse(final String allowedMechanismsProperty); static AllowedMechanisms fromBinaryEncoding(final byte[] binary); byte[] toBinaryEncoding(); Long[] toLongArray(); String toPropertyValue(); @Override String toString();  }### Answer:
@Test public void testToBinaryEncoding() { LOG.info(">testToBinaryEncoding"); String allowedMechanismsProperty = " 0x00000040, 0x00000000, 0x00000250, 0x252, 624, 0x81234567"; AllowedMechanisms instance = AllowedMechanisms.parse(allowedMechanismsProperty); final String expected = "4000000000000000" + "0000000000000000" + "5002000000000000" + "5202000000000000" + "7002000000000000" + "6745238100000000"; assertEquals(expected, Hex.toHexString(instance.toBinaryEncoding())); }