package yokohama.unit.ast;

import java.util.function.Function;

public interface Predicate extends Describable {
    <T> T accept(PredicateVisitor<T> visitor);

    default <T> T accept(
            Function<IsPredicate, T> visitIsPredicate_,
            Function<IsNotPredicate, T> visitIsNotPredicate_,
            Function<ThrowsPredicate, T> visitThrowsPredicate_
    ) {
        return accept(new PredicateVisitor<T>() {
            @Override
            public T visitIsPredicate(IsPredicate isPredicate) {
                return visitIsPredicate_.apply(isPredicate);
            }
            @Override
            public T visitIsNotPredicate(IsNotPredicate isNotPredicate) {
                return visitIsNotPredicate_.apply(isNotPredicate);
            }
            @Override
            public T visitThrowsPredicate(ThrowsPredicate throwsPredicate) {
                return visitThrowsPredicate_.apply(throwsPredicate);
            }
        });
    }
}

@@ -108,24 +108,47 @@
 cribable %7B%0D%0A
+    Span getSpan();%0D%0A%0D%0A
     %3CT%3E T ac

Add abstract getSpan method to Predicate interface