private static <T> Boolean needSearch(Long limit, AbstractMap<T, Long> items) { Long sum = 0L; for (Long v : items.values()) { sum += v; } return sum > limit; }
/** * Returns a shallow copy of this <tt>AbstractMap</tt> instance: the keys and values themselves * are not cloned. * * @return a shallow copy of this map. */ protected Object clone() throws CloneNotSupportedException { AbstractMap result = (AbstractMap) super.clone(); result.keySet = null; result.values = null; return result; }