driver-core/src/main/com/mongodb/client/model/PushOptions.java
public PushOptions sortDocument(@Nullable final Bson sortDocument) {
        if (sort != null) {
            throw new IllegalStateException("sortDocument can not be set if sort already is");
        }
        this.sortDocument = sortDocument;
        return this;
    }
public PushOptions sortDocument(@Nullable final Bson sortDocument) {
        if (sort != null) {
            throw new IllegalStateException("sortDocument can not be set if sort already is");
        }
        this.sortDocument = sortDocument;
        return this;
    }
Sets the sort direction for sorting array elements that are documents.

@param sortDocument the sort document
@return this
@throws IllegalStateException if sort property is already set
@mongodb.driver.manual reference/operator/update/sort/ $sort