### Question:
CreateUidsIterator implements SortedKeyValueIterator<Key,Value>, OptionDescriber { public static Key makeRootKey(Key k) { ByteSequence cq = k.getColumnQualifierData(); ByteSequence strippedCq = cq.subSequence(0, lastNull(cq)); final ByteSequence row = k.getRowData(), cf = k.getColumnFamilyData(), cv = k.getColumnVisibilityData(); return new Key(row.getBackingArray(), row.offset(), row.length(), cf.getBackingArray(), cf.offset(), cf.length(), strippedCq.getBackingArray(), strippedCq.offset(), strippedCq.length(), cv.getBackingArray(), cv.offset(), cv.length(), k.getTimestamp()); }  @Override void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env); @Override boolean hasTop(); @Override void next(); @Override void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive); @Override Key getTopKey(); @Override Value getTopValue(); @Override SortedKeyValueIterator<Key,Value> deepCopy(IteratorEnvironment env); IndexInfo getValue(); static boolean sameShard(Key ref, Key test); static Tuple3<Long,Boolean,List<String>> parseUids(Key k, Value v); static String parseDataType(Key k); static int lastNull(ByteSequence bs); static Key makeRootKey(Key k); @Override IteratorOptions describeOptions(); @Override boolean validateOptions(Map<String,String> options); static final String COLLAPSE_UIDS; static final String PARSE_TLD_UIDS; }### Answer:
@Test public void testMakeRootKey() { Key expectedRootKey = new Key("term", "field", "shard"); Key indexKey = new Key("term", "field", "shard\u0000datatype"); assertEquals(expectedRootKey, CreateUidsIterator.makeRootKey(indexKey)); }