@SuppressWarnings("unchecked")
    default String renderFields(Generator gen, M model) {
        final List<String> rendered;

        if (model instanceof Constructor
        ||  model instanceof Method
        ||  model instanceof InterfaceMethod) {
            model.getFields().forEach(field ->
                field.getModifiers().retainAll(singleton(Modifier.FINAL))
            );
        }

        if (model instanceof Interface) {
            model.getFields().forEach(field ->
                field.getModifiers().clear()
            );
        }

        if (useTripleDot() && !model.getFields().isEmpty()) {
            final String last = gen.on(wrapField(new LinkedList<>(model.getFields()).getLast())).orElseThrow(NoSuchElementException::new);
            if (last.contains("[] ")) {
                rendered = Stream.concat(
                    model.getFields().stream()
                        .limit(model.getFields().size() - 1L)
                        .map(this::wrapField)
                        .map(gen::on)
                        .map(Optional::get),
                    Stream.of(last.replaceFirst("\\[\\] ", "... "))
                ).collect(toList());
            } else {
                rendered = model.getFields().stream()
                    .map(this::wrapField)
                    .map(gen::on)
                    .map(Optional::get)
                    .collect(toList());
            }
        } else {
            rendered = model.getFields().stream()
                .map(this::wrapField)
                .map(gen::on)
                .map(Optional::get)
                .collect(toList());
        }

        return rendered.stream()
            .collect(joinIfNotEmpty(
                fieldSuffix() + fieldSeparator(model) + fieldPrefix(), 
                fieldPrefix(), 
                fieldSuffix()
            ));
    }
Render the fields-part of the model using the 
{@link #fieldSeparator(HasFields)} method to separate the fields and 
the {@link #fieldPrefix()}- and {@link #fieldSuffix()}-methods on each 
field.

@param gen    the generator
@param model  the model
@return       the generated code
common-parent/codegen/src/main/java/com/speedment/common/codegen/internal/java/view/trait/HasFieldsView.java