List<PyElement> (@NotNull PyClass from, @NotNull Collection<? extends PyFunction> methodsToMove, boolean skipIfExist, PyClass @NotNull... to) { if (methodsToMove.isEmpty() || to.length == 0) return Collections.emptyList(); final List<PyElement> result = new ArrayList<>(); for (PyClass destClass : to) { //We move copies here because there may be several destinations PyFunction[] copies = ContainerUtil.map2Array(methodsToMove, PyFunction.EMPTY_ARRAY, m -> (PyFunction)m.copy()); result.addAll(PyClassRefactoringUtil.addMethods(destClass, skipIfExist, copies)); } deleteElements(methodsToMove); return result; }