public static boolean containsAllEntries(final InternalDoubleFloatMapOps map, Map<?, ?> another) { if (map == another) throw new IllegalArgumentException(); if (another instanceof DoubleFloatMap) { DoubleFloatMap m2 = (DoubleFloatMap) another; if (map.size() < m2.size()) return false; if (m2 instanceof InternalDoubleFloatMapOps) { //noinspection unchecked return ((InternalDoubleFloatMapOps) m2).allEntriesContainingIn(map); } return m2.forEachWhile(new DoubleFloatPredicate() { @Override public boolean test(double a, float b) { return map.containsEntry(a, b); } }); } for (Map.Entry<?, ?> e : another.entrySet()) { if (!map.containsEntry((Double) e.getKey(), (Float) e.getValue())) return false; } return true; }
public static boolean containsAllEntries(final InternalDoubleFloatMapOps map, Map<?, ?> another) { if (map == another) throw new IllegalArgumentException(); if (another instanceof DoubleFloatMap) { DoubleFloatMap m2 = (DoubleFloatMap) another; if (map.size() < m2.size()) return false; if (m2 instanceof InternalDoubleFloatMapOps) { //noinspection unchecked return ((InternalDoubleFloatMapOps) m2).allEntriesContainingIn(map); } return m2.forEachWhile(new DoubleFloatPredicate() { @Override public boolean test(double a, float b) { return map.containsEntry(a, b); } }); } for (Map.Entry<?, ?> e : another.entrySet()) { if (!map.containsEntry((Double) e.getKey(), (Float) e.getValue())) return false; } return true; }