package org.beanmaker.util;

public abstract class CacheSortableKeyBase<T extends Comparable<T>> implements Comparable<CacheSortableKeyBase<T>> {

    private final long id;
    private final T sortOrder;

    public CacheSortableKeyBase(final DbBeanInterface bean, final T sortOrder) {
        this.id = bean.getId();
        this.sortOrder = sortOrder;
    }

    public long getId() {
        return id;
    }

    public T getSortOrder() {
        return sortOrder;
    }

    @Override
    public int compareTo(CacheSortableKeyBase<T> key) {
        return sortOrder.compareTo(key.sortOrder);
    }

    // MUST IMPLEMENT EQUALS() HERE
    @Override
    public boolean equals(final Object key) {
        throw new UnsupportedOperationException("Must implement equals in derived class");
    }

    // IMPLEMENTATION MODEL :
    /*public boolean equals(final Object key) {
        if (key == this)
            return true;

        if (key instanceof <your key class>)
            return ((<your key class>) key).getId() == getId();

        return false;
    }*/

    @Override
    public int hashCode() {
        int result = 17;

        final int idEvaluationHash = (int) (id ^ (id >>> 32));
        result = 31 * result + idEvaluationHash;

        return result;
    }
}

@@ -1100,24 +1100,118 @@
 ashCode() %7B%0A
+        return computeHashCode(id);%0A    %7D%0A%0A    protected int computeHashCode(final long id) %7B%0A
         int 
@@ -1242,29 +1242,17 @@
 nal int 
-idEvaluationH
+h
 ash = (i
@@ -1310,21 +1310,9 @@
 t + 
-idEvaluationH
+h
 ash;

Split CacheSortableKeyBase.hashcode() in two functions