### Question:
TLD { public static Key buildParentKey(Text shard, ByteSequence id, ByteSequence cq, Text cv, long ts) { Text ptr = new Text(); ptr.set(id.getBackingArray(), id.offset(), id.length()); Text cqt = new Text(); cqt.set(cq.getBackingArray(), cq.offset(), cq.length()); return new Key(shard, ptr, cqt, cv, ts); } private  TLD(); static ByteSequence parsePointerFromFI(ByteSequence cq); static ByteSequence parseParentPointerFromId(ByteSequence id); static ByteSequence parseFieldAndValueFromFI(ByteSequence cf, ByteSequence cq); static ByteSequence parseFieldAndValueFromTF(ByteSequence cq); static ByteSequence parseRootPointerFromFI(ByteSequence cq); static ByteSequence parseRootPointerFromId(ByteSequence id); static String parseRootPointerFromId(String id); static ByteSequence estimateRootPointerFromId(ByteSequence id); static boolean isRootPointer(ByteSequence id); static ByteSequence fromString(String s); static ArrayList<Integer> instancesOf(int b, ByteSequence sequence); static ArrayList<Integer> instancesOf(int b, ByteSequence sequence, int repeat); static ArrayList<Integer> lastInstancesOf(int b, ByteSequence sequence, int repeat); static Key buildParentKey(Text shard, ByteSequence id, ByteSequence cq, Text cv, long ts); static Key getNextParentKey(Key docKey);  }### Answer:
@Test public void testBuildParentKey() { Key fiKey = buildFiKey(rootId); Text shard = fiKey.getRow(); ByteSequence id = new ArrayByteSequence(rootId); ByteSequence cq = fiKey.getColumnQualifierData(); Text cv = fiKey.getColumnVisibility(); long ts = fiKey.getTimestamp(); Key parentKey = TLD.buildParentKey(shard, id, cq, cv, ts); String cq2 = value + '\u0000' + datatype + '\u0000' + rootId; Key expectedKey = new Key(row, rootId, cq2, fiKey.getTimestamp()); assertEquals(expectedKey, parentKey); id = new ArrayByteSequence(childId); parentKey = TLD.buildParentKey(shard, id, cq, cv, ts); expectedKey = new Key(row, childId, cq2, fiKey.getTimestamp()); assertEquals(expectedKey, parentKey); id = new ArrayByteSequence(grandchildId); parentKey = TLD.buildParentKey(shard, id, cq, cv, ts); expectedKey = new Key(row, grandchildId, cq2, fiKey.getTimestamp()); assertEquals(expectedKey, parentKey); }