class StageBean<T> {

    private final TableIdentifier<T> identifier;
    private final List<Predicate<? super T>> predicates;
    private JoinType joinType;
    private HasComparableOperators<T, ?> field;
    private JoinOperator joinOperator;
    private HasComparableOperators<?, ?> foreignField;
    private int referencedStage;
//    private HasComparableOperators<?, ?> foreignSecondField;
//    private Inclusion foreignInclusion;

    StageBean(TableIdentifier<T> identifier) {
        this.identifier = requireNonNull(identifier);
        this.predicates = new ArrayList<>();
    }

    StageBean(TableIdentifier<T> identifier, JoinType joinType) {
        this.identifier = requireNonNull(identifier);
        this.predicates = new ArrayList<>();
        this.joinType = requireNonNull(joinType);
    }

    StageBean(JoinType joinType, HasComparableOperators<T, ?> field) {
        requireNonNull(field);
        this.identifier = requireNonNull(field.identifier().asTableIdentifier());
        this.predicates = new ArrayList<>();
        this.joinType = requireNonNull(joinType);
        this.field = field;
    }

    JoinType getJoinType() {
        return joinType;
    }

    void setJoinType(JoinType joinType) {
        this.joinType = requireNonNull(joinType);
    }

    HasComparableOperators<? extends T, ?> getField() {
        return field;
    }

    void setField(HasComparableOperators<T, ?> field) {
        this.field = requireNonNull(field);
    }

    JoinOperator getJoinOperator() {
        return joinOperator;
    }

    void setJoinOperator(JoinOperator joinOperator) {
        this.joinOperator = requireNonNull(joinOperator);
    }

    HasComparableOperators<?, ?> getForeignField() {
        return foreignField;
    }

    void setForeignField(HasComparableOperators<?, ?> foreignFirstField) {
        this.foreignField = requireNonNull(foreignFirstField);
    }

    int getReferencedStage() {
        return referencedStage;
    }

    void setReferencedStage(int referencedStage) {
        this.referencedStage = referencedStage;
    }

//    public HasComparableOperators<?, ?> getForeignSecondField() {
//        return foreignSecondField;
//    }
//
//    public void setForeignSecondField(HasComparableOperators<?, ?> foreignSecondField) {
//        this.foreignSecondField = requireNonNull(foreignSecondField);
//    }

     TableIdentifier<T> getIdentifier() {
        return identifier;
    }

    /**
     * This list is intentionally exposed for mutable operation.
     *
     * @return a mutable list
     */
     List<Predicate<? super T>> getPredicates() {
        return predicates;
    }

//    public Inclusion getForeignInclusion() {
//        return foreignInclusion;
//    }
//
//    public void setForeignInclusion(Inclusion foreignInclusion) {
//        this.foreignInclusion = requireNonNull(foreignInclusion);
//    }

    Stage<T> asStage() {<FILL_FUNCTION_BODY>}

}

        return Stage.of(
            identifier,
            predicates,
            joinType,
            field,
            joinOperator,
            foreignField,
            referencedStage
//            foreignSecondField,
//            foreignInclusion
        );
    
<no_super_class>