public static <K> void putAll(final InternalObjByteMapOps<K> map, Map<? extends K, ? extends Byte> another) { if (map == another) throw new IllegalArgumentException(); long maxPossibleSize = map.sizeAsLong() + Containers.sizeAsLong(another); map.ensureCapacity(maxPossibleSize); if (another instanceof ObjByteMap) { if (another instanceof InternalObjByteMapOps) { ((InternalObjByteMapOps) another).reversePutAllTo(map); } else { ((ObjByteMap) another).forEach(new ObjByteConsumer<K>() { @Override public void accept(K key, byte value) { map.justPut(key, value); } }); } } else { for (Map.Entry<? extends K, ? extends Byte> e : another.entrySet()) { map.justPut(e.getKey(), e.getValue()); } } }
public static <K> void putAll(final InternalObjByteMapOps<K> map, Map<? extends K, ? extends Byte> another) { if (map == another) throw new IllegalArgumentException(); long maxPossibleSize = map.sizeAsLong() + Containers.sizeAsLong(another); map.ensureCapacity(maxPossibleSize); if (another instanceof ObjByteMap) { if (another instanceof InternalObjByteMapOps) { ((InternalObjByteMapOps) another).reversePutAllTo(map); } else { ((ObjByteMap) another).forEach(new ObjByteConsumer<K>() { @Override public void accept(K key, byte value) { map.justPut(key, value); } }); } } else { for (Map.Entry<? extends K, ? extends Byte> e : another.entrySet()) { map.justPut(e.getKey(), e.getValue()); } } }