void (@NotNull final Collection<? extends Field> fields, @NotNull final List<? extends Field> currentPath, @NotNull final Collection<? super List<Field>> result, final int deepness) { if (currentPath.size() >= deepness) { return; } fields.stream() .filter(field -> !field.isAnyNameAllowed()) .forEach(field -> { final List<Field> fieldPath = StreamEx.<Field>of(currentPath).append(field).toList(); result.add(fieldPath); final YamlMetaType metaType = field.getType(field.getDefaultRelation()); if (metaType instanceof YamlMetaClass) { doCollectPathsRec(ContainerUtil.filter(((YamlMetaClass)metaType).getFeatures(), Field::isEditable), fieldPath, result, deepness); } }); }