List<String> (@NotNull List<? extends PsiPackageAccessibilityStatement> statements) { final List<String> result = new ArrayList<>(); for (PsiPackageAccessibilityStatement statement : statements) { final List<String> moduleNames = statement.getModuleNames(); if (moduleNames.isEmpty()) { return Collections.emptyList(); } result.addAll(moduleNames); } return result; }