@Test
public void testClosestTo() {

  final List<Class<?>> classes = Lists.newArrayList(C.class, B.class, D.class, A.class);
  classes.sort(closestTo(Object.class));
  assertEquals(Lists.newArrayList(D.class, C.class, B.class, A.class), classes);
  classes.sort(closestTo(D.class));
  assertEquals(Lists.newArrayList(A.class, B.class, C.class, D.class), classes);
}