class BavetIfExistsTriConstraintStream<Solution_, A, B, C, D>
        extends BavetAbstractTriConstraintStream<Solution_, A, B, C> {

    private final BavetAbstractTriConstraintStream<Solution_, A, B, C> parentABC;
    private final BavetIfExistsBridgeUniConstraintStream<Solution_, D> parentBridgeD;

    private final boolean shouldExist;
    private final DefaultQuadJoiner<A, B, C, D> joiner;
    private final QuadPredicate<A, B, C, D> filtering;

    public BavetIfExistsTriConstraintStream(BavetConstraintFactory<Solution_> constraintFactory,
            BavetAbstractTriConstraintStream<Solution_, A, B, C> parentABC,
            BavetIfExistsBridgeUniConstraintStream<Solution_, D> parentBridgeD,
            boolean shouldExist,
            DefaultQuadJoiner<A, B, C, D> joiner, QuadPredicate<A, B, C, D> filtering) {
        super(constraintFactory, parentABC.getRetrievalSemantics());
        this.parentABC = parentABC;
        this.parentBridgeD = parentBridgeD;
        this.shouldExist = shouldExist;
        this.joiner = joiner;
        this.filtering = filtering;
    }

    @Override
    public boolean guaranteesDistinct() {
        return parentABC.guaranteesDistinct();
    }

    // ************************************************************************
    // Node creation
    // ************************************************************************

    @Override
    public void collectActiveConstraintStreams(Set<BavetAbstractConstraintStream<Solution_>> constraintStreamSet) {
        parentABC.collectActiveConstraintStreams(constraintStreamSet);
        parentBridgeD.collectActiveConstraintStreams(constraintStreamSet);
        constraintStreamSet.add(this);
    }

    @Override
    public BavetAbstractConstraintStream<Solution_> getTupleSource() {
        return parentABC.getTupleSource();
    }

    @Override
    public <Score_ extends Score<Score_>> void buildNode(NodeBuildHelper<Score_> buildHelper) {<FILL_FUNCTION_BODY>}

    // ************************************************************************
    // Equality for node sharing
    // ************************************************************************

    // TODO

    @Override
    public String toString() {
        return "IfExists() with " + childStreamList.size() + " children";
    }

    // ************************************************************************
    // Getters/setters
    // ************************************************************************

}

        TupleLifecycle<TriTuple<A, B, C>> downstream = buildHelper.getAggregatedTupleLifecycle(childStreamList);
        IndexerFactory indexerFactory = new IndexerFactory(joiner);
        AbstractIfExistsNode<TriTuple<A, B, C>, D> node = indexerFactory.hasJoiners()
                ? (filtering == null ? new IndexedIfExistsTriNode<>(shouldExist,
                        JoinerUtils.combineLeftMappings(joiner), JoinerUtils.combineRightMappings(joiner),
                        buildHelper.reserveTupleStoreIndex(parentABC.getTupleSource()),
                        buildHelper.reserveTupleStoreIndex(parentABC.getTupleSource()),
                        buildHelper.reserveTupleStoreIndex(parentBridgeD.getTupleSource()),
                        buildHelper.reserveTupleStoreIndex(parentBridgeD.getTupleSource()),
                        downstream, indexerFactory.buildIndexer(true), indexerFactory.buildIndexer(false))
                        : new IndexedIfExistsTriNode<>(shouldExist,
                                JoinerUtils.combineLeftMappings(joiner), JoinerUtils.combineRightMappings(joiner),
                                buildHelper.reserveTupleStoreIndex(parentABC.getTupleSource()),
                                buildHelper.reserveTupleStoreIndex(parentABC.getTupleSource()),
                                buildHelper.reserveTupleStoreIndex(parentABC.getTupleSource()),
                                buildHelper.reserveTupleStoreIndex(parentBridgeD.getTupleSource()),
                                buildHelper.reserveTupleStoreIndex(parentBridgeD.getTupleSource()),
                                buildHelper.reserveTupleStoreIndex(parentBridgeD.getTupleSource()),
                                downstream, indexerFactory.buildIndexer(true), indexerFactory.buildIndexer(false),
                                filtering))
                : (filtering == null ? new UnindexedIfExistsTriNode<>(shouldExist,
                        buildHelper.reserveTupleStoreIndex(parentABC.getTupleSource()),
                        buildHelper.reserveTupleStoreIndex(parentBridgeD.getTupleSource()), downstream)
                        : new UnindexedIfExistsTriNode<>(shouldExist,
                                buildHelper.reserveTupleStoreIndex(parentABC.getTupleSource()),
                                buildHelper.reserveTupleStoreIndex(parentABC.getTupleSource()),
                                buildHelper.reserveTupleStoreIndex(parentBridgeD.getTupleSource()),
                                buildHelper.reserveTupleStoreIndex(parentBridgeD.getTupleSource()),
                                downstream, filtering));
        buildHelper.addNode(node, this, parentBridgeD);
    
<methods>public void <init>(BavetConstraintFactory<Solution_>, org.optaplanner.constraint.streams.common.RetrievalSemantics) ,public BavetAbstractTriConstraintStream<Solution_,A,B,C> filter(TriPredicate<A,B,C>) ,public TriConstraintStream<A,B,ResultC_> flattenLast(Function<C,Iterable<ResultC_>>) ,public List<BavetAbstractTriConstraintStream<Solution_,A,B,C>> getChildStreamList() ,public UniConstraintStream<Result_> groupBy(TriConstraintCollector<A,B,C,ResultContainer_,Result_>) ,public BiConstraintStream<ResultA_,ResultB_> groupBy(TriConstraintCollector<A,B,C,ResultContainerA_,ResultA_>, TriConstraintCollector<A,B,C,ResultContainerB_,ResultB_>) ,public TriConstraintStream<ResultA_,ResultB_,ResultC_> groupBy(TriConstraintCollector<A,B,C,ResultContainerA_,ResultA_>, TriConstraintCollector<A,B,C,ResultContainerB_,ResultB_>, TriConstraintCollector<A,B,C,ResultContainerC_,ResultC_>) ,public QuadConstraintStream<ResultA_,ResultB_,ResultC_,ResultD_> groupBy(TriConstraintCollector<A,B,C,ResultContainerA_,ResultA_>, TriConstraintCollector<A,B,C,ResultContainerB_,ResultB_>, TriConstraintCollector<A,B,C,ResultContainerC_,ResultC_>, TriConstraintCollector<A,B,C,ResultContainerD_,ResultD_>) ,public UniConstraintStream<GroupKey_> groupBy(TriFunction<A,B,C,GroupKey_>) ,public TriConstraintStream<GroupKey_,ResultB_,ResultC_> groupBy(TriFunction<A,B,C,GroupKey_>, TriConstraintCollector<A,B,C,ResultContainerB_,ResultB_>, TriConstraintCollector<A,B,C,ResultContainerC_,ResultC_>) ,public QuadConstraintStream<GroupKey_,ResultB_,ResultC_,ResultD_> groupBy(TriFunction<A,B,C,GroupKey_>, TriConstraintCollector<A,B,C,ResultContainerB_,ResultB_>, TriConstraintCollector<A,B,C,ResultContainerC_,ResultC_>, TriConstraintCollector<A,B,C,ResultContainerD_,ResultD_>) ,public BiConstraintStream<GroupKey_,Result_> groupBy(TriFunction<A,B,C,GroupKey_>, TriConstraintCollector<A,B,C,ResultContainer_,Result_>) ,public BiConstraintStream<GroupKeyA_,GroupKeyB_> groupBy(TriFunction<A,B,C,GroupKeyA_>, TriFunction<A,B,C,GroupKeyB_>) ,public TriConstraintStream<GroupKeyA_,GroupKeyB_,Result_> groupBy(TriFunction<A,B,C,GroupKeyA_>, TriFunction<A,B,C,GroupKeyB_>, TriConstraintCollector<A,B,C,ResultContainer_,Result_>) ,public QuadConstraintStream<GroupKeyA_,GroupKeyB_,ResultC_,ResultD_> groupBy(TriFunction<A,B,C,GroupKeyA_>, TriFunction<A,B,C,GroupKeyB_>, TriConstraintCollector<A,B,C,ResultContainerC_,ResultC_>, TriConstraintCollector<A,B,C,ResultContainerD_,ResultD_>) ,public TriConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_> groupBy(TriFunction<A,B,C,GroupKeyA_>, TriFunction<A,B,C,GroupKeyB_>, TriFunction<A,B,C,GroupKeyC_>) ,public QuadConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_,ResultD_> groupBy(TriFunction<A,B,C,GroupKeyA_>, TriFunction<A,B,C,GroupKeyB_>, TriFunction<A,B,C,GroupKeyC_>, TriConstraintCollector<A,B,C,ResultContainerD_,ResultD_>) ,public QuadConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_,GroupKeyD_> groupBy(TriFunction<A,B,C,GroupKeyA_>, TriFunction<A,B,C,GroupKeyB_>, TriFunction<A,B,C,GroupKeyC_>, TriFunction<A,B,C,GroupKeyD_>) ,public final transient TriConstraintStream<A,B,C> ifExists(Class<D>, QuadJoiner<A,B,C,D>[]) ,public final transient TriConstraintStream<A,B,C> ifExists(UniConstraintStream<D>, QuadJoiner<A,B,C,D>[]) ,public final transient TriConstraintStream<A,B,C> ifExistsIncludingNullVars(Class<D>, QuadJoiner<A,B,C,D>[]) ,public final transient TriConstraintStream<A,B,C> ifNotExists(Class<D>, QuadJoiner<A,B,C,D>[]) ,public final transient TriConstraintStream<A,B,C> ifNotExists(UniConstraintStream<D>, QuadJoiner<A,B,C,D>[]) ,public final transient TriConstraintStream<A,B,C> ifNotExistsIncludingNullVars(Class<D>, QuadJoiner<A,B,C,D>[]) ,public TriConstraintBuilder<A,B,C,Score_> innerImpact(Score_, ToIntTriFunction<A,B,C>, org.optaplanner.constraint.streams.common.ScoreImpactType) ,public TriConstraintBuilder<A,B,C,Score_> innerImpact(Score_, ToLongTriFunction<A,B,C>, org.optaplanner.constraint.streams.common.ScoreImpactType) ,public TriConstraintBuilder<A,B,C,Score_> innerImpact(Score_, TriFunction<A,B,C,java.math.BigDecimal>, org.optaplanner.constraint.streams.common.ScoreImpactType) ,public final transient QuadConstraintStream<A,B,C,D> join(UniConstraintStream<D>, QuadJoiner<A,B,C,D>[]) ,public UniConstraintStream<ResultA_> map(TriFunction<A,B,C,ResultA_>) ,public Stream_ shareAndAddChild(Stream_) <variables>protected final List<BavetAbstractTriConstraintStream<Solution_,A,B,C>> childStreamList