ArrayList<PaletteGroup> (@Nullable VirtualFile selectedFile) { ArrayList<PaletteGroup> result = new ArrayList<>(); if (selectedFile != null) { for (PaletteItemProvider provider : myProviders) { PaletteGroup[] groups = provider.getActiveGroups(selectedFile); Collections.addAll(result, groups); } } return result; }