- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 30 for getOnlyElement (0.34 seconds)
-
guava-tests/test/com/google/common/collect/IteratorsTest.java
Iterator<String> iterator = singletonList("foo").iterator(); assertThat(getOnlyElement(iterator)).isEqualTo("foo"); } public void testGetOnlyElement_noDefault_empty() { Iterator<String> iterator = emptyIterator(); assertThrows(NoSuchElementException.class, () -> getOnlyElement(iterator)); } public void testGetOnlyElement_noDefault_moreThanOneLessThanFiveElements() {
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Fri Mar 13 13:01:07 GMT 2026 - 57.3K bytes - Click Count (0) -
android/guava-tests/test/com/google/common/collect/IteratorsTest.java
Iterator<String> iterator = singletonList("foo").iterator(); assertThat(getOnlyElement(iterator)).isEqualTo("foo"); } public void testGetOnlyElement_noDefault_empty() { Iterator<String> iterator = emptyIterator(); assertThrows(NoSuchElementException.class, () -> getOnlyElement(iterator)); } public void testGetOnlyElement_noDefault_moreThanOneLessThanFiveElements() {
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Fri Mar 13 13:01:07 GMT 2026 - 57.3K bytes - Click Count (0) -
guava/src/com/google/common/collect/ImmutableEnumMap.java
* limitations under the License. */ package com.google.common.collect; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.collect.Iterables.getOnlyElement; import com.google.common.annotations.GwtCompatible; import com.google.common.annotations.GwtIncompatible; import com.google.common.annotations.J2ktIncompatible;
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Sun Mar 08 16:16:42 GMT 2026 - 4.3K bytes - Click Count (0) -
guava-testlib/test/com/google/common/testing/TearDownStackTest.java
* See the License for the specific language governing permissions and * limitations under the License. */ package com.google.common.testing; import static com.google.common.collect.Iterables.getOnlyElement; import static com.google.common.truth.Truth.assertThat; import static java.util.Arrays.asList; import com.google.common.annotations.GwtCompatible; import junit.framework.TestCase;
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Tue Mar 17 16:11:48 GMT 2026 - 4.5K bytes - Click Count (0) -
guava-tests/test/com/google/common/collect/CompactHashMapTest.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.Iterables.getOnlyElement; import static com.google.common.truth.Truth.assertThat; import static java.lang.Math.max; import com.google.common.collect.testing.MapTestSuiteBuilder; import com.google.common.collect.testing.TestStringMapGenerator;
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Thu Mar 12 17:47:10 GMT 2026 - 5.4K bytes - Click Count (0) -
guava-tests/test/com/google/common/collect/IterablesTest.java
} public void testGetOnlyElement_withDefault_singleton() { Iterable<String> iterable = singletonList("foo"); assertThat(getOnlyElement(iterable, "bar")).isEqualTo("foo"); } public void testGetOnlyElement_withDefault_empty() { Iterable<String> iterable = emptyList(); assertThat(getOnlyElement(iterable, "bar")).isEqualTo("bar"); }
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Fri Mar 13 13:01:07 GMT 2026 - 47.5K bytes - Click Count (0) -
android/guava-testlib/test/com/google/common/testing/TearDownStackTest.java
* See the License for the specific language governing permissions and * limitations under the License. */ package com.google.common.testing; import static com.google.common.collect.Iterables.getOnlyElement; import static com.google.common.truth.Truth.assertThat; import static java.util.Arrays.asList; import com.google.common.annotations.GwtCompatible; import junit.framework.TestCase;
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Tue Mar 17 16:11:48 GMT 2026 - 4.5K bytes - Click Count (0) -
android/guava-testlib/src/com/google/common/collect/testing/google/MapGenerators.java
* limitations under the License. */ package com.google.common.collect.testing.google; import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.collect.Iterables.getOnlyElement; import static com.google.common.collect.Maps.immutableEnumMap; import static com.google.common.collect.testing.Helpers.mapEntry; import static java.util.Arrays.asList; import com.google.common.annotations.GwtCompatible;
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Fri Dec 26 20:08:09 GMT 2025 - 8.6K bytes - Click Count (0) -
guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableMap.java
import static com.google.common.base.Preconditions.checkState; import static com.google.common.collect.CollectPreconditions.checkEntryNotNull; import static com.google.common.collect.Iterables.getOnlyElement; import com.google.errorprone.annotations.CanIgnoreReturnValue; import java.io.Serializable; import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.EnumMap;
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Tue Mar 17 15:51:42 GMT 2026 - 17.2K bytes - Click Count (0) -
guava-tests/test/com/google/common/util/concurrent/MoreExecutorsTest.java
List<Future<String>> results; results = service.invokeAll(callables); assertThat(getOnlyElement(results)).isInstanceOf(TrustedListenableFutureTask.class); results = service.invokeAll(callables, 1, SECONDS); assertThat(getOnlyElement(results)).isInstanceOf(TrustedListenableFutureTask.class); /* * TODO(cpovirk): move ForwardingTestCase somewhere common, and use it to
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Mon Mar 16 22:45:21 GMT 2026 - 26.1K bytes - Click Count (0)