@Override public AbstractEdgeMap<T> clear() { if (isEmpty()) { return this; } return new EmptyEdgeMap<T>(minIndex, maxIndex); }
@Override public Map<Integer, T> toMap() { if (isEmpty()) { return Collections.emptyMap(); } synchronized (this) { Map<Integer, T> result = new LinkedHashMap<Integer, T>(); for (int i = 0; i < size(); i++) { result.put(keys[i], values.get(i)); } return result; } }