public static @NotNull <T> ObjectPattern.Capture<T> optional(final ElementPattern<T> pattern) {
    return new ObjectPattern.Capture<>(new InitialPatternCondition(Object.class) {
      @Override
      public boolean accepts(final @Nullable Object o, final ProcessingContext context) {
        pattern.accepts(o, context);
        return true;
      }
    });
  }
public static @NotNull <T> ObjectPattern.Capture<T> optional(final ElementPattern<T> pattern)