@Test public void testOneElementToString() { SafeIterableMap<Integer, Boolean> map = mapOf(1); assertThat(map.toString(), is("[1=true]")); }
@Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("["); Iterator<Map.Entry<K, V>> iterator = iterator(); while (iterator.hasNext()) { builder.append(iterator.next().toString()); if (iterator.hasNext()) { builder.append(", "); } } builder.append("]"); return builder.toString(); }
SafeIterableMap implements Iterable<Map.Entry<K, V>> { @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("["); Iterator<Map.Entry<K, V>> iterator = iterator(); while (iterator.hasNext()) { builder.append(iterator.next().toString()); if (iterator.hasNext()) { builder.append(", "); } } builder.append("]"); return builder.toString(); } }
SafeIterableMap implements Iterable<Map.Entry<K, V>> { @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("["); Iterator<Map.Entry<K, V>> iterator = iterator(); while (iterator.hasNext()) { builder.append(iterator.next().toString()); if (iterator.hasNext()) { builder.append(", "); } } builder.append("]"); return builder.toString(); }  }
SafeIterableMap implements Iterable<Map.Entry<K, V>> { @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("["); Iterator<Map.Entry<K, V>> iterator = iterator(); while (iterator.hasNext()) { builder.append(iterator.next().toString()); if (iterator.hasNext()) { builder.append(", "); } } builder.append("]"); return builder.toString(); }  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>> { @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("["); Iterator<Map.Entry<K, V>> iterator = iterator(); while (iterator.hasNext()) { builder.append(iterator.next().toString()); if (iterator.hasNext()) { builder.append(", "); } } builder.append("]"); return builder.toString(); }  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();  }