protected String compare(Field f) {
        requireNonNull(f);
        
        final StringBuilder str = new StringBuilder(".filter(o -> ");
        if (isPrimitive(f.getType())) {
            str.append("(this.")
                .append(f.getName())
                .append(" == o.")
                .append(f.getName())
                .append(")");
        } else {
            str.append("Objects.equals(this.")
                .append(f.getName())
                .append(", o.")
                .append(f.getName())
                .append(")");
        }
        
        return str.append(")").toString();
    }
Generates code for comparing the specified field in this and another
object.

@param f  the field
@return   the comparing code
common-parent/codegen/src/main/java/com/speedment/common/codegen/controller/AutoEquals.java