Iterables { public static <K, V> LinkedHashMap<K,V> newLinkedHashMapWithSize( int expectedSize ) { return new LinkedHashMap<>( hashMapCapacity( expectedSize ) ); }  static int count( Iterable<?> it ); static List<T> asList( Iterable<T> it ); static T single( Iterable<T> it ); static Map<String, String> map( String ... alternatingKeyValue ); static Iterable<B> map(final Iterable<A> it, final Function<A,B> f); @SuppressWarnings( "unchecked" ) static Queue<T> emptyQueue(); static HashMap<K,V> newHashMapWithSize( int expectedSize ); static LinkedHashMap<K,V> newLinkedHashMapWithSize( int expectedSize );  }
@Test void shouldCreateLinkedHashMapWithExpectedSize() { assertNotNull( Iterables.newLinkedHashMapWithSize( 42 ) ); }
@Test void shouldThrowWhenNegativeLinkedHashMapSizeGiven() { assertThrows( IllegalArgumentException.class, () -> Iterables.newLinkedHashMapWithSize( -42 ) ); }