class BavetJoinQuadConstraintStream<Solution_, A, B, C, D>
        extends BavetAbstractQuadConstraintStream<Solution_, A, B, C, D>
        implements BavetJoinConstraintStream<Solution_> {

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

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

    public BavetJoinQuadConstraintStream(BavetConstraintFactory<Solution_> constraintFactory,
            BavetJoinBridgeTriConstraintStream<Solution_, A, B, C> leftParent,
            BavetJoinBridgeUniConstraintStream<Solution_, D> rightParent,
            DefaultQuadJoiner<A, B, C, D> joiner, QuadPredicate<A, B, C, D> 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) {
        int outputStoreSize = buildHelper.extractTupleStoreSize(this);
        TupleLifecycle<QuadTuple<A, B, C, D>> downstream = buildHelper.getAggregatedTupleLifecycle(childStreamList);
        IndexerFactory indexerFactory = new IndexerFactory(joiner);
        AbstractJoinNode<TriTuple<A, B, C>, D, QuadTuple<A, B, C, D>, QuadTupleImpl<A, B, C, D>> node =
                indexerFactory.hasJoiners()
                        ? new IndexedJoinQuadNode<>(
                                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 UnindexedJoinQuadNode<>(
                                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);
    }

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

    @Override
    public boolean equals(Object o) {<FILL_FUNCTION_BODY>}

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

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

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

}

        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        BavetJoinQuadConstraintStream<?, ?, ?, ?, ?> other = (BavetJoinQuadConstraintStream<?, ?, ?, ?, ?>) 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);
    
<methods>public void <init>(BavetConstraintFactory<Solution_>, org.optaplanner.constraint.streams.common.RetrievalSemantics) ,public BavetAbstractQuadConstraintStream<Solution_,A,B,C,D> filter(QuadPredicate<A,B,C,D>) ,public QuadConstraintStream<A,B,C,ResultD_> flattenLast(Function<D,Iterable<ResultD_>>) ,public List<BavetAbstractQuadConstraintStream<Solution_,A,B,C,D>> getChildStreamList() ,public UniConstraintStream<Result_> groupBy(QuadConstraintCollector<A,B,C,D,ResultContainer_,Result_>) ,public BiConstraintStream<ResultA_,ResultB_> groupBy(QuadConstraintCollector<A,B,C,D,ResultContainerA_,ResultA_>, QuadConstraintCollector<A,B,C,D,ResultContainerB_,ResultB_>) ,public TriConstraintStream<ResultA_,ResultB_,ResultC_> groupBy(QuadConstraintCollector<A,B,C,D,ResultContainerA_,ResultA_>, QuadConstraintCollector<A,B,C,D,ResultContainerB_,ResultB_>, QuadConstraintCollector<A,B,C,D,ResultContainerC_,ResultC_>) ,public QuadConstraintStream<ResultA_,ResultB_,ResultC_,ResultD_> groupBy(QuadConstraintCollector<A,B,C,D,ResultContainerA_,ResultA_>, QuadConstraintCollector<A,B,C,D,ResultContainerB_,ResultB_>, QuadConstraintCollector<A,B,C,D,ResultContainerC_,ResultC_>, QuadConstraintCollector<A,B,C,D,ResultContainerD_,ResultD_>) ,public UniConstraintStream<GroupKey_> groupBy(QuadFunction<A,B,C,D,GroupKey_>) ,public TriConstraintStream<GroupKey_,ResultB_,ResultC_> groupBy(QuadFunction<A,B,C,D,GroupKey_>, QuadConstraintCollector<A,B,C,D,ResultContainerB_,ResultB_>, QuadConstraintCollector<A,B,C,D,ResultContainerC_,ResultC_>) ,public QuadConstraintStream<GroupKey_,ResultB_,ResultC_,ResultD_> groupBy(QuadFunction<A,B,C,D,GroupKey_>, QuadConstraintCollector<A,B,C,D,ResultContainerB_,ResultB_>, QuadConstraintCollector<A,B,C,D,ResultContainerC_,ResultC_>, QuadConstraintCollector<A,B,C,D,ResultContainerD_,ResultD_>) ,public BiConstraintStream<GroupKey_,Result_> groupBy(QuadFunction<A,B,C,D,GroupKey_>, QuadConstraintCollector<A,B,C,D,ResultContainer_,Result_>) ,public BiConstraintStream<GroupKeyA_,GroupKeyB_> groupBy(QuadFunction<A,B,C,D,GroupKeyA_>, QuadFunction<A,B,C,D,GroupKeyB_>) ,public TriConstraintStream<GroupKeyA_,GroupKeyB_,Result_> groupBy(QuadFunction<A,B,C,D,GroupKeyA_>, QuadFunction<A,B,C,D,GroupKeyB_>, QuadConstraintCollector<A,B,C,D,ResultContainer_,Result_>) ,public QuadConstraintStream<GroupKeyA_,GroupKeyB_,ResultC_,ResultD_> groupBy(QuadFunction<A,B,C,D,GroupKeyA_>, QuadFunction<A,B,C,D,GroupKeyB_>, QuadConstraintCollector<A,B,C,D,ResultContainerC_,ResultC_>, QuadConstraintCollector<A,B,C,D,ResultContainerD_,ResultD_>) ,public TriConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_> groupBy(QuadFunction<A,B,C,D,GroupKeyA_>, QuadFunction<A,B,C,D,GroupKeyB_>, QuadFunction<A,B,C,D,GroupKeyC_>) ,public QuadConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_,ResultD_> groupBy(QuadFunction<A,B,C,D,GroupKeyA_>, QuadFunction<A,B,C,D,GroupKeyB_>, QuadFunction<A,B,C,D,GroupKeyC_>, QuadConstraintCollector<A,B,C,D,ResultContainerD_,ResultD_>) ,public QuadConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_,GroupKeyD_> groupBy(QuadFunction<A,B,C,D,GroupKeyA_>, QuadFunction<A,B,C,D,GroupKeyB_>, QuadFunction<A,B,C,D,GroupKeyC_>, QuadFunction<A,B,C,D,GroupKeyD_>) ,public final transient QuadConstraintStream<A,B,C,D> ifExists(Class<E>, PentaJoiner<A,B,C,D,E>[]) ,public final transient QuadConstraintStream<A,B,C,D> ifExists(UniConstraintStream<E>, PentaJoiner<A,B,C,D,E>[]) ,public final transient QuadConstraintStream<A,B,C,D> ifExistsIncludingNullVars(Class<E>, PentaJoiner<A,B,C,D,E>[]) ,public final transient QuadConstraintStream<A,B,C,D> ifNotExists(Class<E>, PentaJoiner<A,B,C,D,E>[]) ,public final transient QuadConstraintStream<A,B,C,D> ifNotExists(UniConstraintStream<E>, PentaJoiner<A,B,C,D,E>[]) ,public final transient QuadConstraintStream<A,B,C,D> ifNotExistsIncludingNullVars(Class<E>, PentaJoiner<A,B,C,D,E>[]) ,public QuadConstraintBuilder<A,B,C,D,Score_> innerImpact(Score_, ToIntQuadFunction<A,B,C,D>, org.optaplanner.constraint.streams.common.ScoreImpactType) ,public QuadConstraintBuilder<A,B,C,D,Score_> innerImpact(Score_, ToLongQuadFunction<A,B,C,D>, org.optaplanner.constraint.streams.common.ScoreImpactType) ,public QuadConstraintBuilder<A,B,C,D,Score_> innerImpact(Score_, QuadFunction<A,B,C,D,java.math.BigDecimal>, org.optaplanner.constraint.streams.common.ScoreImpactType) ,public UniConstraintStream<ResultA_> map(QuadFunction<A,B,C,D,ResultA_>) ,public Stream_ shareAndAddChild(Stream_) <variables>protected final List<BavetAbstractQuadConstraintStream<Solution_,A,B,C,D>> childStreamList