core/src/main/java/com/orientechnologies/common/comparator/OComparatorFactory.java
@SuppressWarnings("unchecked")
  public <T> Comparator<T> getComparator(Class<T> clazz) {
    boolean useUnsafe = OGlobalConfiguration.MEMORY_USE_UNSAFE.getValueAsBoolean();

    if (clazz.equals(byte[].class)) {
      if (useUnsafe && unsafeWasDetected)
        return (Comparator<T>) OUnsafeByteArrayComparator.INSTANCE;

      return (Comparator<T>) OByteArrayComparator.INSTANCE;
    }

    return null;
  }
@SuppressWarnings("unchecked")
  public <T> Comparator<T> getComparator(Class<T> clazz) {
    boolean useUnsafe = OGlobalConfiguration.MEMORY_USE_UNSAFE.getValueAsBoolean();

    if (clazz.equals(byte[].class)) {
      if (useUnsafe && unsafeWasDetected)
        return (Comparator<T>) OUnsafeByteArrayComparator.INSTANCE;

      return (Comparator<T>) OByteArrayComparator.INSTANCE;
    }

    return null;
  }
@ SuppressWarnings ( "unchecked" ) public < T > Comparator < T > getComparator ( Class < T > clazz ) { boolean useUnsafe = OGlobalConfiguration . MEMORY_USE_UNSAFE . getValueAsBoolean ( ) ; if ( clazz . equals ( byte [ ] . class ) ) { if ( useUnsafe && unsafeWasDetected ) return ( Comparator < T > ) OUnsafeByteArrayComparator . INSTANCE ; return ( Comparator < T > ) OByteArrayComparator . INSTANCE ; } return null ; }
Returns {@link Comparator} instance if applicable one exist or <code>null</code> otherwise.

@param clazz
Class of object that is going to be compared.
@param <T>
Class of object that is going to be compared.
@return {@link Comparator} instance if applicable one exist or <code>null</code> otherwise.
Returns { @link Comparator } instance if applicable one exist or <code > null< / code > otherwise .