class CapturePattern<T> extends Pattern<T> {

    private final Capture<T> capture;
    private final Pattern<T> pattern;

    CapturePattern(Capture<T> capture, Pattern<T> pattern) {
        this.capture = capture;
        this.pattern = pattern;
    }

    @Override
    public Match<T> accept(Object object, Captures captures, UnaryOperator<LogicalPlan> resolvePlan) {<FILL_FUNCTION_BODY>}
}

        Match<T> match = pattern.accept(object, captures, resolvePlan);
        return match.flatMap(val -> Match.of(val, captures.add(Captures.of(capture, val))));
    
<methods>public non-sealed void <init>() ,public abstract Match<T> accept(java.lang.Object, io.crate.planner.optimizer.matcher.Captures, UnaryOperator<io.crate.planner.operators.LogicalPlan>) ,public Match<T> accept(java.lang.Object, io.crate.planner.optimizer.matcher.Captures) ,public Pattern<T> capturedAs(Capture<T>) ,public static Pattern<T> typeOf(Class<T>) ,public Pattern<T> with(Function<? super T,Optional<U>>, Pattern<V>) ,public Pattern<T> with(Predicate<? super T>) <variables>