- Sort Score
- Result 10 results
- Languages All
Results 1 - 4 of 4 for onlyElement (0.07 sec)
-
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 Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Oct 18 20:24:49 UTC 2024 - 3.2K bytes - Viewed (0) -
guava-tests/benchmark/com/google/common/collect/StreamsBenchmark.java
* See the License for the specific language governing permissions and * limitations under the License. */ package com.google.common.collect; import static com.google.common.collect.MoreCollectors.onlyElement; import com.google.caliper.BeforeExperiment; import com.google.caliper.Benchmark; import com.google.caliper.Param; import com.google.caliper.api.SkipThisScenarioException; import java.util.ArrayList;
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Oct 18 20:24:49 UTC 2024 - 2.8K 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 Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 16 21:21:17 UTC 2024 - 5.6K bytes - Viewed (0) -
guava/src/com/google/common/collect/ImmutableList.java
* `length` array elements. */ @SuppressWarnings("unchecked") // our callers put only E instances into the array E onlyElement = (E) requireNonNull(elements[0]); return of(onlyElement); default: /* * The suppression is safe because the callers promise to put non-null objects in the first * `length` array elements. */
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Aug 16 19:14:45 UTC 2024 - 30.5K bytes - Viewed (0)