Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for testOnlyElement (0.06 sec)

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

                IllegalArgumentException.class,
                () -> Stream.of(1, 2, 3, 4, 5, 6).collect(toOptional()));
        assertThat(expected.getMessage()).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);
      }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 20:24:49 UTC 2024
    - 3.2K bytes
    - Viewed (0)
Back to top