@Test public void buildMap() { try { HashMap<String, Integer> map4 = MapUtil.newHashMap(new String[] { "1", "2" }, new Integer[] { 1 }); fail("should fail here"); } catch (Exception e) { assertThat(e).isInstanceOf(IllegalArgumentException.class); assertThat(e).hasMessage("keys.length is 2 but values.length is 1"); } }
@Deprecated public static <K, V> HashMap<K, V> newHashMap() { return new HashMap<K, V>(); }
MapUtil { @Deprecated public static <K, V> HashMap<K, V> newHashMap() { return new HashMap<K, V>(); } }
MapUtil { @Deprecated public static <K, V> HashMap<K, V> newHashMap() { return new HashMap<K, V>(); }  }
MapUtil { @Deprecated public static <K, V> HashMap<K, V> newHashMap() { return new HashMap<K, V>(); }  static boolean isEmpty(final Map<?, ?> map); static boolean isNotEmpty(final Map<?, ?> map); static V putIfAbsentReturnLast(@NotNull final ConcurrentMap<K, V> map, final K key, final V value); static V createIfAbsentReturnLast(@NotNull final ConcurrentMap<K, V> map, final K key,
			@NotNull final ValueCreator<? extends V> creator); @Deprecated static HashMap<K, V> newHashMap(); static HashMap<K, V> newHashMapWithCapacity(int expectedSize, float loadFactor); static HashMap<K, V> newHashMap(final K key, final V value); static HashMap<K, V> newHashMap(@NotNull final K[] keys, @NotNull final V[] values); static HashMap<K, V> newHashMap(@NotNull final List<K> keys, @NotNull final List<V> values); @SuppressWarnings("rawtypes") static TreeMap<K, V> newSortedMap(); static TreeMap<K, V> newSortedMap(@Nullable Comparator<C> comparator); static EnumMap<K, V> newEnumMap(@NotNull Class<K> type); static ConcurrentHashMap<K, V> newConcurrentHashMap(); static ConcurrentSkipListMap<K, V> newConcurrentSortedMap(); static Map<K, V> emptyMap(); static Map<K, V> emptyMapIfNull(final Map<K, V> map); static Map<K, V> singletonMap(final K key, final V value); static Map<K, V> unmodifiableMap(final Map<? extends K, ? extends V> m); static SortedMap<K, V> unmodifiableSortedMap(final SortedMap<K, ? extends V> m); static MapDifference<K, V> difference(Map<? extends K, ? extends V> left,
			Map<? extends K, ? extends V> right); static Map<K, V> sortByValue(Map<K, V> map, final boolean reverse); static Map<K, V> sortByValue(Map<K, V> map, final Comparator<? super V> comparator); static Map<K, V> topNByValue(Map<K, V> map, final boolean reverse, int n); static Map<K, V> topNByValue(Map<K, V> map, final Comparator<? super V> comparator, int n); }
MapUtil { @Deprecated public static <K, V> HashMap<K, V> newHashMap() { return new HashMap<K, V>(); }  static boolean isEmpty(final Map<?, ?> map); static boolean isNotEmpty(final Map<?, ?> map); static V putIfAbsentReturnLast(@NotNull final ConcurrentMap<K, V> map, final K key, final V value); static V createIfAbsentReturnLast(@NotNull final ConcurrentMap<K, V> map, final K key,
			@NotNull final ValueCreator<? extends V> creator); @Deprecated static HashMap<K, V> newHashMap(); static HashMap<K, V> newHashMapWithCapacity(int expectedSize, float loadFactor); static HashMap<K, V> newHashMap(final K key, final V value); static HashMap<K, V> newHashMap(@NotNull final K[] keys, @NotNull final V[] values); static HashMap<K, V> newHashMap(@NotNull final List<K> keys, @NotNull final List<V> values); @SuppressWarnings("rawtypes") static TreeMap<K, V> newSortedMap(); static TreeMap<K, V> newSortedMap(@Nullable Comparator<C> comparator); static EnumMap<K, V> newEnumMap(@NotNull Class<K> type); static ConcurrentHashMap<K, V> newConcurrentHashMap(); static ConcurrentSkipListMap<K, V> newConcurrentSortedMap(); static Map<K, V> emptyMap(); static Map<K, V> emptyMapIfNull(final Map<K, V> map); static Map<K, V> singletonMap(final K key, final V value); static Map<K, V> unmodifiableMap(final Map<? extends K, ? extends V> m); static SortedMap<K, V> unmodifiableSortedMap(final SortedMap<K, ? extends V> m); static MapDifference<K, V> difference(Map<? extends K, ? extends V> left,
			Map<? extends K, ? extends V> right); static Map<K, V> sortByValue(Map<K, V> map, final boolean reverse); static Map<K, V> sortByValue(Map<K, V> map, final Comparator<? super V> comparator); static Map<K, V> topNByValue(Map<K, V> map, final boolean reverse, int n); static Map<K, V> topNByValue(Map<K, V> map, final Comparator<? super V> comparator, int n); static final float DEFAULT_LOAD_FACTOR; }