Node (Configurable configurable) { SearchableConfigurable sc = (SearchableConfigurable)configurable; if (configurable instanceof Configurable.Composite composite) { return node(sc.getId(), Arrays.asList(composite.getConfigurables())); } return node(sc.getId()); }