- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for onlyElement (0.05 sec)
-
android/guava-tests/test/com/google/common/collect/MoreCollectorsTest.java
assertThrows(NoSuchElementException.class, () -> Stream.empty().collect(onlyElement())); } public void testOnlyElementSingleton() { assertThat(Stream.of(1).collect(onlyElement())).isEqualTo(1); } public void testOnlyElementNull() { assertThat(Stream.<@Nullable Object>of((Object) null).collect(onlyElement())).isNull(); } public void testOnlyElementMultiple() {
Registered: Fri Dec 26 12:43:10 UTC 2025 - Last Modified: Thu May 15 21:47:56 UTC 2025 - 3.2K bytes - Viewed (0) -
android/guava/src/com/google/common/collect/MoreCollectors.java
* more elements, and a {@code NoSuchElementException} if the stream is empty. */ @SuppressWarnings("unchecked") public static <T extends @Nullable Object> Collector<T, ?, T> onlyElement() { return (Collector) ONLY_ELEMENT; } /** * This atrocity is here to let us report several of the elements in the stream if there were more * than one, not just two. */Registered: Fri Dec 26 12:43:10 UTC 2025 - Last Modified: Mon Apr 14 16:07:06 UTC 2025 - 5.6K bytes - Viewed (0)