@Override
  protected void doUnwrap(PsiElement element, Context context) throws IncorrectOperationException {
    PsiElement from = findElementToExtractFrom(element);

    final PsiMethod[] methods = ((PsiAnonymousClass)element).getMethods();

    if (methods.length == 1) {
      final PsiCodeBlock body = methods[0].getBody();
      if (body != null) {
        final PsiStatement[] statements = body.getStatements();
        if (statements.length == 1 && statements[0] instanceof PsiReturnStatement) {
          final PsiExpression returnValue = ((PsiReturnStatement)statements[0]).getReturnValue();
          if (toAssignment(context, from, returnValue)) return;
        }
      }
    }

    for (PsiMethod m : methods) {
      context.extractFromCodeBlock(m.getBody(), from);
    }

    PsiElement next = from.getNextSibling();
    if (PsiUtil.isJavaToken(next, JavaTokenType.SEMICOLON)) {
      context.deleteExactly(from.getNextSibling());
    }
    context.deleteExactly(from);
  }
@Override
  protected void doUnwrap(PsiElement element, Context context)