class ClassFieldsDefault implements ClassFields {

    @Override
    public Iterator<Field> getFields() {
        // cache declared fields of a class
        if (declaredFields == null) {
            if (getInheritedFields) {
                declaredFields = getAllFields(clazz).toArray(new Field[getAllFields(clazz).size()]);
            } else {
                declaredFields = clazz.getDeclaredFields();
            }
        }

        // filter some of the fields including this$0 used in inner classes
        final Iterator<Field> fields = Arrays.stream(declaredFields)
                .filter(field -> !field.getName().equals("serialVersionUID"))
                .filter(field -> !field.getName().equals("this$0"))
                .iterator();

        return fields;
    }

    public  ClassFieldsDefault(final Class clazz, final Boolean getInheritedFields);
    public  ClassFieldsDefault(final Class clazz);

}