private static PsiUnnamedPattern createUnnamedPattern(PsiElementFactory factory) {
    PsiInstanceOfExpression expr = (PsiInstanceOfExpression)factory
      .createExpressionFromText("x instanceof R(_)", null);
    PsiDeconstructionPattern pattern = (PsiDeconstructionPattern)Objects.requireNonNull(expr.getPattern());
    return ((PsiUnnamedPattern)pattern.getDeconstructionList().getDeconstructionComponents()[0]);
  }
private static PsiUnnamedPattern createUnnamedPattern(PsiElementFactory factory)