### Question:
TLD { public static ArrayList<Integer> instancesOf(int b, ByteSequence sequence) { return instancesOf(b, sequence, -1); } 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 testInstancesOf() { ByteSequence bytes = new ArrayByteSequence("how.many.dots.do.we.have?"); ArrayList<Integer> expectedPositions = Lists.newArrayList(3, 8, 13, 16, 19); ArrayList<Integer> instances = TLD.instancesOf('.', bytes); assertEquals(expectedPositions, instances); }
@Test public void testInstancesOfWithRepeat() { ByteSequence bytes = new ArrayByteSequence("how.many.dots.do.we.have?"); ArrayList<Integer> expectedPositions = Lists.newArrayList(3, 8, 13); ArrayList<Integer> instances = TLD.instancesOf('.', bytes, 3); assertEquals(expectedPositions, instances); }
@Test public void testInstancesOfWithNullBytes() { ByteSequence bytes = new ArrayByteSequence(new byte[] {0, 1, 0, 1, 0}); ArrayList<Integer> positions = TLD.instancesOf(0, bytes); assertEquals(3, positions.size()); for (int ii = 0; ii < positions.size(); ii++) { assertEquals(ii * 2, positions.get(ii).intValue()); } }