class FindPackageNamesQuery extends AbstractFindQuery implements NamedQuery {

    @Override
    public Query toQuery(Set<ValueIndexTerm> terms) {
        final SearchEmptyQueryBuilder queryBuilder = new SearchEmptyQueryBuilder();

        for (ValueIndexTerm term : terms) {
            if (term instanceof ValueModuleRootPathIndexTerm
                    || term instanceof ValuePackageNameIndexTerm) {
                queryBuilder.addTerm(term);
            }
        }

        return queryBuilder.build();
    }

}