String (Set<Class<?>> importedClasses) { return importedClasses.stream() .filter(cls -> !cls.getPackage().equals(myTestClass.getPackage())) .map(Class::getName) .sorted() .map(name -> "import " + name + ";\n").collect(Collectors.joining()); }