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