List<String> (final PyImportElement @NotNull ... elements) { final List<String> result = new ArrayList<>(elements.length); for (final PyImportElement element : elements) { final QualifiedName qName = element.getImportedQName(); if (qName != null) { result.add(qName.toString()); } } return result; }