@SuppressWarnings({"unchecked", "rawtypes"})
    public static int compareTo(final Comparable thisValue, final Comparable otherValue, final OrderDirection orderDirection, final NullsOrderType nullsOrderType,
                                final boolean caseSensitive) {
        if (null == thisValue && null == otherValue) {
            return 0;
        }
        if (null == thisValue) {
            return NullsOrderType.FIRST == nullsOrderType ? -1 : 1;
        }
        if (null == otherValue) {
            return NullsOrderType.FIRST == nullsOrderType ? 1 : -1;
        }
        if (!caseSensitive && thisValue instanceof String && otherValue instanceof String) {
            return compareToCaseInsensitiveString((String) thisValue, (String) otherValue, orderDirection);
        }
        return OrderDirection.ASC == orderDirection ? thisValue.compareTo(otherValue) : -thisValue.compareTo(otherValue);
    }
@Test
    void assertCompareToWhenFirstValueIsNullForOrderByDescAndNullsFirst() {
        assertThat(CompareUtils.compareTo(null, 1, OrderDirection.DESC, NullsOrderType.FIRST, caseSensitive), is(-1));
    }