@Test public void buildTest() { final Map<String, Integer> map = MapBuilder.<String, Integer>builder().put("1", 1).put("2", 2).build(); Assert.assertEquals(map.size(), 2); final Map<String, Integer> concurrentMap = MapBuilder.<String, Integer>create(ReflectUtils.convert(ConcurrentHashMap.class)).put("1", 1).build(); Assert.assertEquals(concurrentMap instanceof ConcurrentMap, true); }
public Map<K, V> build() { return map; }
MapBuilder { public Map<K, V> build() { return map; } }
MapBuilder { public Map<K, V> build() { return map; } private  MapBuilder(); }
MapBuilder { public Map<K, V> build() { return map; } private  MapBuilder(); static MapBuilder<K, V> builder(); static MapBuilder<K, V> create(Class<? extends Map<K, V>> cls, Object... params); MapBuilder<K, V> put(K key, V value); Map<K, V> build(); }
MapBuilder { public Map<K, V> build() { return map; } private  MapBuilder(); static MapBuilder<K, V> builder(); static MapBuilder<K, V> create(Class<? extends Map<K, V>> cls, Object... params); MapBuilder<K, V> put(K key, V value); Map<K, V> build();  }