class BatchConditionQuery extends ConditionQuery {

    private Condition.Relation in;
    private final int batchSize;

    public BatchConditionQuery(HugeType resultType, int batchSize) {
        super(resultType);
        this.in = null;
        this.batchSize = batchSize;
    }

    public void mergeToIN(ConditionQuery query, HugeKeys key) {<FILL_FUNCTION_BODY>}

    protected boolean sameQueryExceptKeyIN(ConditionQuery query) {
        List<Condition.Relation> relations = query.relations();
        if (relations.size() != this.relations().size()) {
            return false;
        }

        for (Condition.Relation r : this.relations()) {
            if (r.relation() == RelationType.IN) {
                continue;
            }
            Object key = r.key();
            if (!Objects.equals(this.condition(key), query.condition(key))) {
                return false;
            }
        }
        return true;
    }
}

        Object value = query.condition(key);
        if (this.in == null) {
            assert !this.containsRelation(RelationType.IN);
            this.resetConditions(InsertionOrderUtil.newList(
                    (List<Condition>) query.conditions()));
            this.unsetCondition(key);

            List<Object> list = new ArrayList<>(this.batchSize);
            list.add(value);
            // TODO: ensure not flatten BatchQuery
            this.in = (Condition.Relation) Condition.in(key, list);
            this.query(this.in);
        } else {
            E.checkArgument(this.in.key().equals(key),
                            "Invalid key '%s'", key);
            E.checkArgument(this.sameQueryExceptKeyIN(query),
                            "Can't merge query with different keys");

            @SuppressWarnings("unchecked")
            List<Object> values = ((List<Object>) this.in.value());
            values.add(value);
        }
    
<methods>public void <init>(org.apache.hugegraph.type.HugeType) ,public void <init>(org.apache.hugegraph.type.HugeType, org.apache.hugegraph.backend.query.Query) ,public boolean allRelation() ,public boolean allSysprop() ,public void checkFlattened() ,public static java.lang.String concatValues(List<?>) ,public static java.lang.String concatValues(java.lang.Object) ,public T condition(java.lang.Object) ,public Collection<org.apache.hugegraph.backend.query.Condition> conditions() ,public int conditionsSize() ,public boolean containsCondition(org.apache.hugegraph.type.define.HugeKeys) ,public boolean containsContainsCondition(org.apache.hugegraph.backend.id.Id) ,public boolean containsRelation(org.apache.hugegraph.type.define.HugeKeys, org.apache.hugegraph.backend.query.Condition.RelationType) ,public boolean containsRelation(org.apache.hugegraph.backend.query.Condition.RelationType) ,public boolean containsScanRelation() ,public org.apache.hugegraph.backend.query.ConditionQuery copy() ,public org.apache.hugegraph.backend.query.ConditionQuery copyAndResetUnshared() ,public org.apache.hugegraph.backend.query.Condition.Relation copyRelationAndUpdateQuery(java.lang.Object) ,public org.apache.hugegraph.backend.query.ConditionQuery eq(org.apache.hugegraph.type.define.HugeKeys, java.lang.Object) ,public boolean existLeftIndex(org.apache.hugegraph.backend.id.Id) ,public Set<org.apache.hugegraph.backend.query.ConditionQuery.LeftIndex> getLeftIndexOfElement(org.apache.hugegraph.backend.id.Id) ,public org.apache.hugegraph.backend.query.ConditionQuery gt(org.apache.hugegraph.type.define.HugeKeys, java.lang.Object) ,public org.apache.hugegraph.backend.query.ConditionQuery gte(org.apache.hugegraph.type.define.HugeKeys, java.lang.Object) ,public boolean hasNeqCondition() ,public boolean hasRangeCondition() ,public boolean hasSearchCondition() ,public boolean hasSecondaryCondition() ,public boolean isFlattened() ,public org.apache.hugegraph.backend.query.ConditionQuery key(org.apache.hugegraph.type.define.HugeKeys, java.lang.Object) ,public org.apache.hugegraph.backend.query.ConditionQuery lt(org.apache.hugegraph.type.define.HugeKeys, java.lang.Object) ,public org.apache.hugegraph.backend.query.ConditionQuery lte(org.apache.hugegraph.type.define.HugeKeys, java.lang.Object) ,public boolean matchUserpropKeys(List<org.apache.hugegraph.backend.id.Id>) ,public boolean mayHasDupKeys(Set<org.apache.hugegraph.type.define.HugeKeys>) ,public org.apache.hugegraph.backend.query.ConditionQuery neq(org.apache.hugegraph.type.define.HugeKeys, java.lang.Object) ,public void optimized(org.apache.hugegraph.backend.query.ConditionQuery.OptimizedType) ,public org.apache.hugegraph.backend.query.ConditionQuery.OptimizedType optimized() ,public org.apache.hugegraph.backend.query.ConditionQuery originConditionQuery() ,public org.apache.hugegraph.backend.query.ConditionQuery prefix(org.apache.hugegraph.type.define.HugeKeys, org.apache.hugegraph.backend.id.Id) ,public org.apache.hugegraph.backend.query.ConditionQuery query(org.apache.hugegraph.backend.query.Condition) ,public org.apache.hugegraph.backend.query.ConditionQuery query(List<org.apache.hugegraph.backend.query.Condition>) ,public void recordIndexValue(org.apache.hugegraph.backend.id.Id, org.apache.hugegraph.backend.id.Id, java.lang.Object) ,public void registerResultsFilter(org.apache.hugegraph.backend.query.ConditionQuery.ResultsFilter) ,public org.apache.hugegraph.backend.query.Condition.Relation relation(org.apache.hugegraph.backend.id.Id) ,public List<org.apache.hugegraph.backend.query.Condition.Relation> relations() ,public void removeElementLeftIndex(org.apache.hugegraph.backend.id.Id) ,public void resetConditions(List<org.apache.hugegraph.backend.query.Condition>) ,public void resetConditions() ,public void resetUserpropConditions() ,public org.apache.hugegraph.backend.query.ConditionQuery scan(java.lang.String, java.lang.String) ,public void selectedIndexField(org.apache.hugegraph.backend.id.Id) ,public List<org.apache.hugegraph.backend.query.Condition> syspropConditions() ,public List<org.apache.hugegraph.backend.query.Condition> syspropConditions(org.apache.hugegraph.type.define.HugeKeys) ,public boolean test(org.apache.hugegraph.structure.HugeElement) ,public void unsetCondition(java.lang.Object) ,public void updateResultsFilter() ,public List<org.apache.hugegraph.backend.query.Condition> userpropConditions() ,public List<org.apache.hugegraph.backend.query.Condition> userpropConditions(org.apache.hugegraph.backend.id.Id) ,public Set<org.apache.hugegraph.backend.id.Id> userpropKeys() ,public List<org.apache.hugegraph.backend.query.Condition.Relation> userpropRelations() ,public java.lang.Object userpropValue(org.apache.hugegraph.backend.id.Id) ,public Set<java.lang.Object> userpropValues(org.apache.hugegraph.backend.id.Id) ,public java.lang.String userpropValuesString(List<org.apache.hugegraph.backend.id.Id>) <variables>private static final List<org.apache.hugegraph.backend.query.Condition> EMPTY_CONDITIONS,public static final non-sealed Set<java.lang.String> IGNORE_SYM_SET,public static final java.lang.String INDEX_SYM_EMPTY,public static final java.lang.String INDEX_SYM_ENDING,public static final char INDEX_SYM_MAX,public static final char INDEX_SYM_MIN,public static final java.lang.String INDEX_SYM_NULL,public static final java.lang.String INDEX_VALUE_EMPTY,public static final java.lang.String INDEX_VALUE_NULL,private List<org.apache.hugegraph.backend.query.Condition> conditions,private org.apache.hugegraph.backend.query.ConditionQuery.Element2IndexValueMap element2IndexValueMap,private org.apache.hugegraph.backend.query.ConditionQuery.OptimizedType optimizedType,private org.apache.hugegraph.backend.query.ConditionQuery.ResultsFilter resultsFilter