boolean (final Object element, final PsiDirectory directory) { if (super.canRepresent(element, directory)) return true; if (element instanceof PackageElement packageElement) { return Arrays.asList(packageElement.getPackage().getDirectories()).contains(directory); } return false; }