protected void acceptEquals(T model) {
        requireNonNull(model);
            
        if (importer != null) {
            importer.add(Import.of(Objects.class));
            importer.add(Import.of(Optional.class));
        }
        
        model.add(Method.of(EQUALS, boolean.class)
            .set(
                Javadoc.of(
                    "Compares this object with the specified one for equality. " +
                    "The other object must be of the same type and not null for " +
                    "the method to return true."
                )
                .add(PARAM.setValue("other").setText("The object to compare with."))
                .add(RETURN.setText("True if the objects are equal."))
            ).public_()
            .add(OVERRIDE)
            .add(Field.of("other", Object.class))
            .add("return Optional.ofNullable(other)")
            .call(m -> {
                if (HasSupertype.class.isAssignableFrom(model.getClass())) {
                    final Optional<Type> supertype = ((HasSupertype<?>) model).getSupertype();
                    if (supertype.isPresent()) {
                        m.add(Formatting.tab() + ".filter(o -> super.equals(o))");
                    }
                }
            })
            .add(Formatting.tab() + ".filter(o -> getClass().equals(o.getClass()))")
            .add(Formatting.tab() + ".map(o -> (" + model.getName() + ") o)")
            .add(Formatting.tab() + model.getFields().stream().map(this::compare).collect(
                    Collectors.joining(Formatting.nl() + Formatting.tab())
                ))
            .add(Formatting.tab() + ".isPresent();")
        );
        
    }
The <code>equals()</code>-part of the <code>accept</code> method.

@param model  the model
common-parent/codegen/src/main/java/com/speedment/common/codegen/controller/AutoEquals.java