public void stop() {
            if (clause instanceof MinShouldMatchVal) {
                clause =
                        new MinShouldMatchClause(((MinShouldMatchVal) clause).getVal(), subclauses);
            } else if (subclauses != null) {
                Clause subclause;
                if (subclauses.size() == 1) {
                    subclause = subclauses.get(0);
                } else {
                    subclause = new OrClause(subclauses);
                }
                clause = new AndClause(clause, subclause);
            }

            if (parent.subclauses == null) {
                parent.subclauses = Collections.singletonList(clause);
            } else {
                if (parent.subclauses.size() == 1) {
                    parent.subclauses = new ArrayList<>(parent.subclauses);
                }
                parent.subclauses.add(clause);
            }

            current = current.parent;
        }
Shim class used during building of actual classes.
This temporarily holds the value of the minShouldMatchClause
so that the actual MinShouldMatchClause can have a cleaner/immutable
initialization.
tika-core/src/main/java/org/apache/tika/mime/MimeTypesReader.java