Here you can find the source of addToAnd(T target, Map... items)
@SuppressWarnings("unchecked") public static <T extends Map<String, Object>> T addToAnd(T target, Map... items)
//package com.java2s; //License from project: Apache License import java.util.List; import java.util.Map; public class Main { @SuppressWarnings("unchecked") public static <T extends Map<String, Object>> T addToAnd(T target, Map... items) { for (Map item : items) ((List) target.get("$and")).add(item); return target; }//from w w w .j av a 2 s. co m }