### Question:
TLD { public static ByteSequence estimateRootPointerFromId(ByteSequence id) { if (id.length() > 21) { for (int i = 21; i < id.length(); ++i) { if (id.byteAt(i) == '.') { return id.subSequence(0, i); } } return id.subSequence(0, id.length()); } return parseParentPointerFromId(id); } 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 testEstimateRootPointerFromId() { ByteSequence root = new ArrayByteSequence(rootId); ByteSequence child = new ArrayByteSequence(childId); ByteSequence grandchild = new ArrayByteSequence(grandchildId); assertEquals(root, TLD.estimateRootPointerFromId(root)); assertEquals(child, TLD.estimateRootPointerFromId(child)); assertEquals(child, TLD.estimateRootPointerFromId(grandchild)); }