List<Field> (@Nullable YAMLMapping existingMapping) { Set<String> processedNames = new HashSet<>(); LinkedHashSet<Field> result = new LinkedHashSet<>(); for (YamlMetaType nextSubType : myTypes) { if (nextSubType instanceof YamlScalarType) { continue; } List<Field> subTypeCompletions = nextSubType.computeKeyCompletions(existingMapping); for (Field nextField : subTypeCompletions) { String nextFieldName = nextField.getName(); if (!processedNames.contains(nextFieldName)) { Field mergedField = findFeatureByName(nextFieldName); processedNames.add(nextFieldName); result.add(mergedField); } } } return new LinkedList<>(result); }