class DataTypes extends Registry<DataType> {

  @VisibleForTesting
  static Comparator<Class<?>> closestTo(Class<?> target) {
    return (o1, o2) -> {
      if (o1 == o2) {
        return 0;
      }
      if (o1 == null) {
        return -1;
      } else if (o2 == null) {
        return 1;
      }
      if (o1 == target) {
        return 1;
      } else if (o2 == target) {
        return -1;
      }
      return Integer.compare(distance(o2, target), distance(o1, target));
    };
  }

  public  DataTypes();

}