public static @NotNull <E> ObjectPattern.Capture<E> not(final ElementPattern<E> pattern) {
    return new ObjectPattern.Capture<>(new InitialPatternConditionPlus(Object.class) {
      @Override
      public boolean accepts(final @Nullable Object o, final ProcessingContext context) {
        return !pattern.accepts(o, context);
      }

      @Override
      public void append(final @NotNull @NonNls StringBuilder builder, final String indent) {
        pattern.getCondition().append(builder.append("not("), indent + "  ");
        builder.append(")");
      }

      @Override
      public List<ElementPattern<?>> getPatterns() {
        return Collections.singletonList(pattern);
      }
    });
  }
public static @NotNull <E> ObjectPattern.Capture<E> not(final ElementPattern<E> pattern)