### Question:
TLD { public static ByteSequence parseRootPointerFromId(ByteSequence id) { ArrayList<Integer> dots = instancesOf('.', id); int stop; if (dots.size() > 2) { stop = dots.get(2); } else { stop = id.length(); } return id.subSequence(0, stop); } 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 testParseRootPointerFromId_String() { assertEquals(rootId, TLD.parseRootPointerFromId(rootId)); assertEquals(rootId, TLD.parseRootPointerFromId(childId)); assertEquals(rootId, TLD.parseRootPointerFromId(grandchildId)); }
@Test public void testParseRootPointerFromId_ByteSequence() { assertEquals(root, TLD.parseRootPointerFromId(root)); assertEquals(root, TLD.parseRootPointerFromId(child)); assertEquals(root, TLD.parseRootPointerFromId(grandchild)); }