void (@NotNull JavaDuplicatesExtractMethodProcessor processor, @NotNull List<? extends DuplicateNode> selectedNodes) { Map<DuplicateNode, Match> selectedDuplicates = findSelectedDuplicates(processor, selectedNodes); processor.doExtract(); processor.initParametrizedDuplicates(false); for (Match duplicate : selectedDuplicates.values()) { processor.processMatch(duplicate); } PsiMethodCallExpression methodCall = processor.getMethodCall(); if (methodCall != null && methodCall.isValid()) { Editor editor = getEditor(methodCall.getContainingFile(), false); if (editor != null) { editor.getSelectionModel().removeSelection(); editor.getCaretModel().moveToOffset(methodCall.getTextOffset()); } } }