TreeStructureProvider (final NodeWrapper rootWrapper) { return new TreeStructureProvider() { @NotNull @Override public Collection<AbstractTreeNode<?>> modify(@NotNull AbstractTreeNode<?> parent, @NotNull Collection<AbstractTreeNode<?>> children, ViewSettings settings) { if (parent instanceof NodeWrapper) { return children; } List<AbstractTreeNode<?>> result = new ArrayList<>(); result.add(rootWrapper); return result; } }; }