### Question:
PathEncoder { @Nonnull private static byte[] encodeBinaryPath(byte[] path) { int lpath = path.length; int lencoded = lpath / 8 + (lpath % 8 == 0 ? 0 : 1); byte[] encoded = new byte[lencoded]; int nbyte = 0; for (int k = 0; k < lpath; k++) { int offset = k % 8; if (k > 0 && offset == 0) { nbyte++; } if (path[k] == 0) { continue; } encoded[nbyte] |= 0x80 >> offset; } return encoded; } private  PathEncoder();   }### Answer:
@Test public void encodeBinaryPath() { byte[] path = new byte[] { 0x00, 0x01, 0x01 }; byte[] encoded = PathEncoder.encode(path); Assert.assertNotNull(encoded); Assert.assertArrayEquals(new byte[] { 0x60 }, encoded); }