Iterables { @SuppressWarnings( "unchecked" ) public static <T> Queue<T> emptyQueue() { return (Queue<T>) EMPTY_QUEUE; }  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 shouldReturnEmptyQueue() { Queue<Object> queue = Iterables.emptyQueue(); assertEquals( 0, queue.size() ); assertTrue( queue.isEmpty() ); assertNull( queue.peek() ); assertNull( queue.poll() ); assertThrows( UnsupportedOperationException.class, () -> queue.add( "Hello" ) ); assertThrows( UnsupportedOperationException.class, () -> queue.offer( "World" ) ); }
@Test void shouldReturnSameEmptyQueue() { assertSame( Iterables.emptyQueue(), Iterables.emptyQueue() ); }