### Question:
CompactEncoding { public static Bytes decode(final Bytes encoded) { final int size = encoded.size(); checkArgument(size > 0); final byte metadata = encoded.get(0); checkArgument((metadata & 0xc0) == 0, "Invalid compact encoding"); final boolean isLeaf = (metadata & 0x20) != 0; final int pathLength = ((size - 1) * 2) + (isLeaf ? 1 : 0); final MutableBytes path; int i = 0; if ((metadata & 0x10) != 0) { path = MutableBytes.create(pathLength + 1); path.set(i++, (byte) (metadata & 0x0f)); } else { path = MutableBytes.create(pathLength); } for (int j = 1; j < size; j++) { final byte b = encoded.get(j); path.set(i++, (byte) ((b >>> 4) & 0x0f)); path.set(i++, (byte) (b & 0x0f)); } if (isLeaf) { path.set(i, LEAF_TERMINATOR); } return path; } private  CompactEncoding(); static Bytes bytesToPath(final Bytes bytes); static Bytes pathToBytes(final Bytes path); static Bytes encode(final Bytes path); static Bytes decode(final Bytes encoded);  }### Answer:
@Test public void decode() { assertThat(CompactEncoding.decode(Bytes.of(0x11, 0x23, 0x45))) .isEqualTo(Bytes.of(0x01, 0x02, 0x03, 0x04, 0x05)); assertThat(CompactEncoding.decode(Bytes.of(0x00, 0x01, 0x23, 0x45))) .isEqualTo(Bytes.of(0x00, 0x01, 0x02, 0x03, 0x04, 0x05)); assertThat(CompactEncoding.decode(Bytes.of(0x20, 0x0f, 0x1c, 0xb8))) .isEqualTo(Bytes.of(0x00, 0x0f, 0x01, 0x0c, 0x0b, 0x08, 0x10)); assertThat(CompactEncoding.decode(Bytes.of(0x3f, 0x1c, 0xb8))) .isEqualTo(Bytes.of(0x0f, 0x01, 0x0c, 0x0b, 0x08, 0x10)); }