@Override
  public boolean isEmptyMiddleDirectory(final PsiDirectory directory,
                                        final boolean strictlyEmpty,
                                        @Nullable PsiFileSystemItemFilter filter) {
    return JavaDirectoryService.getInstance().getPackage(directory) != null &&
           TreeViewUtil.isEmptyMiddlePackage(directory, strictlyEmpty, filter);
  }
@Override
  public boolean isEmptyMiddleDirectory(final PsiDirectory directory,
                                        final boolean strictlyEmpty,
                                        @Nullable PsiFileSystemItemFilter filter)