class FieldScanner {

    public FieldData scanAnnotations(Class modelClass) {
        FieldData.Builder builder = FieldData.builder();
        ImmutableMap.Builder<String,Field> fieldMap = ImmutableMap.builder();

        Map<Class,Field> found = new HashMap<>();
        Set<String> scannedFields = new HashSet<>();

        for (java.lang.reflect.Field field : modelClass.getDeclaredFields()) {
            String fieldName = field.getName();
            addToMap(builder, fieldMap, found, fieldName, field, isFieldOptional(field));
            scannedFields.add(fieldName);
        }
        for (Method method : modelClass.getDeclaredMethods()) {
            String fieldName = toFieldName(method);
            if (fieldName != null && !scannedFields.contains(fieldName)) {
                addToMap(builder, fieldMap, found, fieldName, method, isMethodFieldOptional(method));
            }
        }
        builder.map(fieldMap.build());
        return builder.build();
    }

}