src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
private void checkNonNullComparable(final Object o,
                                               final int index) {

        if (o == null) {
            throw new NullPointerException(dataName[index]
                                           + " cannot be null");
        }

        if (comparators[index] == null && !(o instanceof Comparable)) {
            throw new ClassCastException(dataName[index]
                                         + " must be Comparable");
        }
    }
private void checkNonNullComparable(final Object o,
                                               final int index) {

        if (o == null) {
            throw new NullPointerException(dataName[index]
                                           + " cannot be null");
        }

        if (comparators[index] == null && !(o instanceof Comparable)) {
            throw new ClassCastException(dataName[index]
                                         + " must be Comparable");
        }
    }
check if an object is fit to be proper input ... has to be
Comparable if the comparator has not been set and non-null

@param o the object being checked
@param index KEY or VALUE (used to put the right word in the
exception message)

@throws NullPointerException if o is null
@throws ClassCastException if o is not Comparable and the
equivalent comparator has not been set