@Override public boolean isEmpty() { for (Segment<K, V> segment : segments) { if (segment.size() > 0) return false; } return true; }
@Override public int size() { long total = 0; for (Segment<K, V> segment : segments) { total += segment.size(); } return (int) Math.min(Integer.MAX_VALUE, total); }