Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 1 of 1 for testOnlyElement (0.14 seconds)

  1. android/guava-tests/test/com/google/common/collect/MoreCollectorsTest.java

                IllegalArgumentException.class,
                () -> Stream.of(1, 2, 3, 4, 5, 6).collect(toOptional()));
        assertThat(expected).hasMessageThat().contains("1, 2, 3, 4, 5, ...");
      }
    
      public void testOnlyElement() {
        assertThrows(NoSuchElementException.class, () -> Stream.empty().collect(onlyElement()));
      }
    
      public void testOnlyElementSingleton() {
        assertThat(Stream.of(1).collect(onlyElement())).isEqualTo(1);
      }
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Thu May 15 21:47:56 GMT 2025
    - 3.2K bytes
    - Click Count (0)
Back to Top