fun <K, V> newEmptyHashMap(iterable: Iterable<*>?): HashMap<K, V>? { return if (iterable is Collection<*>) Maps.newHashMapWithExpectedSize( iterable.size ) else Maps.newHashMap() }
Returns an empty map with expected size matching the iterable size if it 's of type Collection . Otherwise , an empty map with the default size is returned .