@Test public void testBuildBuilder() { Map<String, Integer> map = new MapBuilder<String, Integer>() .put("key1", 1) .put("key2", 2) .getMap(); assertEquals((Integer)1, map.get("key1")); assertEquals((Integer)2, map.get("key2")); }
public MapBuilder<K, V> put(K key, V val) { map.put(key, val); return this; }
MapBuilder { public MapBuilder<K, V> put(K key, V val) { map.put(key, val); return this; } }
MapBuilder { public MapBuilder<K, V> put(K key, V val) { map.put(key, val); return this; } MapBuilder();  MapBuilder(K key, V val); }
MapBuilder { public MapBuilder<K, V> put(K key, V val) { map.put(key, val); return this; } MapBuilder();  MapBuilder(K key, V val); MapBuilder<K, V> put(K key, V val); }
MapBuilder { public MapBuilder<K, V> put(K key, V val) { map.put(key, val); return this; } MapBuilder();  MapBuilder(K key, V val); MapBuilder<K, V> put(K key, V val);  }