class AbstractValueHolder implements ValueHolder {

    @Override
    public boolean equals(Object obj) {
        if (obj != null && obj.getClass() == this.getClass()) {

            Object v1 = getValue();
            Object v2 = ((ValueHolder) obj).getValue();

            if (v1 == null) {
                return v2 == null;
            }
            if (v2 != null) {
                return v1.equals(v2);
            }
        }
        return false;
    }

}