class QueryToMongodb {

    public static Bson getRoots(final String field, final Collection<String> roots) {
        if (roots.size() == 1) {
            return eq(field, roots.iterator().next());
        }
        final String[] values = new String[roots.size()];
        int i = 0;
        for (final String node : roots) {
            values[i++] = node;
        }
        return in(field, values);
    }

    private  QueryToMongodb();

}