class BavetJoinTriConstraintStream<Solution_, A, B, C>
        extends BavetAbstractTriConstraintStream<Solution_, A, B, C>
        implements BavetJoinConstraintStream<Solution_> {

    private final BavetJoinBridgeBiConstraintStream<Solution_, A, B> leftParent;
    private final BavetJoinBridgeUniConstraintStream<Solution_, C> rightParent;

    private final DefaultTriJoiner<A, B, C> joiner;
    private final TriPredicate<A, B, C> filtering;

    public BavetJoinTriConstraintStream(BavetConstraintFactory<Solution_> constraintFactory,
            BavetJoinBridgeBiConstraintStream<Solution_, A, B> leftParent,
            BavetJoinBridgeUniConstraintStream<Solution_, C> rightParent,
            DefaultTriJoiner<A, B, C> joiner, TriPredicate<A, B, C> filtering) {
        super(constraintFactory, leftParent.getRetrievalSemantics());
        this.leftParent = leftParent;
        this.rightParent = rightParent;
        this.joiner = joiner;
        this.filtering = filtering;
    }

    @Override
    public boolean guaranteesDistinct() {
        return leftParent.guaranteesDistinct() && rightParent.guaranteesDistinct();
    }

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

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

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

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

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        BavetJoinTriConstraintStream<?, ?, ?, ?> other = (BavetJoinTriConstraintStream<?, ?, ?, ?>) o;
        /*
         * Bridge streams do not implement equality because their equals() would have to point back to this stream,
         * resulting in StackOverflowError.
         * Therefore we need to check bridge parents to see where this join node comes from.
         */
        return Objects.equals(leftParent.getParent(), other.leftParent.getParent())
                && Objects.equals(rightParent.getParent(), other.rightParent.getParent())
                && Objects.equals(joiner, other.joiner)
                && Objects.equals(filtering, other.filtering);
    }

    @Override
    public int hashCode() {
        return Objects.hash(leftParent.getParent(), rightParent.getParent(), joiner, filtering);
    }

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

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

}

        int outputStoreSize = buildHelper.extractTupleStoreSize(this);
        TupleLifecycle<TriTuple<A, B, C>> downstream = buildHelper.getAggregatedTupleLifecycle(childStreamList);
        IndexerFactory indexerFactory = new IndexerFactory(joiner);
        AbstractJoinNode<BiTuple<A, B>, C, TriTuple<A, B, C>, TriTupleImpl<A, B, C>> node = indexerFactory.hasJoiners()
                ? new IndexedJoinTriNode<>(
                        JoinerUtils.combineLeftMappings(joiner), JoinerUtils.combineRightMappings(joiner),
                        buildHelper.reserveTupleStoreIndex(leftParent.getTupleSource()),
                        buildHelper.reserveTupleStoreIndex(leftParent.getTupleSource()),
                        buildHelper.reserveTupleStoreIndex(leftParent.getTupleSource()),
                        buildHelper.reserveTupleStoreIndex(rightParent.getTupleSource()),
                        buildHelper.reserveTupleStoreIndex(rightParent.getTupleSource()),
                        buildHelper.reserveTupleStoreIndex(rightParent.getTupleSource()),
                        downstream, filtering, outputStoreSize + 2,
                        outputStoreSize, outputStoreSize + 1,
                        indexerFactory.buildIndexer(true), indexerFactory.buildIndexer(false))
                : new UnindexedJoinTriNode<>(
                        buildHelper.reserveTupleStoreIndex(leftParent.getTupleSource()),
                        buildHelper.reserveTupleStoreIndex(leftParent.getTupleSource()),
                        buildHelper.reserveTupleStoreIndex(rightParent.getTupleSource()),
                        buildHelper.reserveTupleStoreIndex(rightParent.getTupleSource()),
                        downstream, filtering, outputStoreSize + 2,
                        outputStoreSize, outputStoreSize + 1);
        buildHelper.addNode(node, leftParent, rightParent);
    
<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