### Question:
ComparatorRegistry { public Comparator<?, ?> comparatorFor(Class<?> type) { return registry.get(type); } ComparatorRegistry(ComparatorType comparatorType); ComparatorType getComparatorType(); Comparator<?, ?> comparatorFor(Class<?> type);  }### Answer:
@Test public void typical() { Comparator<?, ?> objectComparator = comparatorRegistry.comparatorFor(FieldSchema.class); assertThat(objectComparator, is(instanceOf(FieldSchemaComparator.class))); Comparator<?, ?> integerComparator = comparatorRegistry.comparatorFor(PartitionAndMetadata.class); assertThat(integerComparator, is(instanceOf(PartitionAndMetadataComparator.class))); Comparator<?, ?> stringComparator = comparatorRegistry.comparatorFor(TableAndMetadata.class); assertThat(stringComparator, is(instanceOf(TableAndMetadataComparator.class))); assertThat(comparatorRegistry.comparatorFor(Table.class), is(nullValue())); assertThat(comparatorRegistry.comparatorFor(Partition.class), is(nullValue())); }