@Test public void testAddExisted() { SafeIterableMap<Integer, Integer> map = from(1, 2, 3, 4).to(10, 20, 261, 40); assertThat(map.putIfAbsent(3, 239), is(261)); assertThat(map, is(from(1, 2, 3, 4).to(10, 20, 261, 40))); }
public V putIfAbsent(@NonNull K key, @NonNull V v) { Entry<K, V> entry = get(key); if (entry != null) { return entry.mValue; } put(key, v); return null; }
SafeIterableMap implements Iterable<Map.Entry<K, V>> { public V putIfAbsent(@NonNull K key, @NonNull V v) { Entry<K, V> entry = get(key); if (entry != null) { return entry.mValue; } put(key, v); return null; } }
SafeIterableMap implements Iterable<Map.Entry<K, V>> { public V putIfAbsent(@NonNull K key, @NonNull V v) { Entry<K, V> entry = get(key); if (entry != null) { return entry.mValue; } put(key, v); return null; }  }
SafeIterableMap implements Iterable<Map.Entry<K, V>> { public V putIfAbsent(@NonNull K key, @NonNull V v) { Entry<K, V> entry = get(key); if (entry != null) { return entry.mValue; } put(key, v); return null; }  V putIfAbsent(@NonNull K key, @NonNull V v); V remove(@NonNull K key); int size(); @NonNull @Override Iterator<Map.Entry<K, V>> iterator(); Iterator<Map.Entry<K, V>> descendingIterator(); IteratorWithAdditions iteratorWithAdditions(); Map.Entry<K, V> eldest(); Map.Entry<K, V> newest(); @Override boolean equals(Object obj); @Override String toString(); }
SafeIterableMap implements Iterable<Map.Entry<K, V>> { public V putIfAbsent(@NonNull K key, @NonNull V v) { Entry<K, V> entry = get(key); if (entry != null) { return entry.mValue; } put(key, v); return null; }  V putIfAbsent(@NonNull K key, @NonNull V v); V remove(@NonNull K key); int size(); @NonNull @Override Iterator<Map.Entry<K, V>> iterator(); Iterator<Map.Entry<K, V>> descendingIterator(); IteratorWithAdditions iteratorWithAdditions(); Map.Entry<K, V> eldest(); Map.Entry<K, V> newest(); @Override boolean equals(Object obj); @Override String toString();  }