Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 45 for getOnlyElement (0.25 sec)

  1. guava-testlib/src/com/google/common/collect/testing/google/MultimapAsMapTester.java

        resetContainer(Helpers.mapEntry(k0(), v0()), Helpers.mapEntry(k0(), v3()));
    
        Set<Entry<K, Collection<V>>> asMapEntrySet = multimap().asMap().entrySet();
        Collection<V> valueCollection = Iterables.getOnlyElement(asMapEntrySet).getValue();
        assertContentsAnyOrder(valueCollection, v0(), v3());
        assertTrue(multimap().put(k0(), v4()));
        assertContentsAnyOrder(valueCollection, v0(), v3(), v4());
      }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Jan 09 20:10:38 GMT 2018
    - 5.6K bytes
    - Viewed (0)
  2. guava-testlib/src/com/google/common/collect/testing/google/MultisetEntrySetTester.java

      @MultisetFeature.Require(ENTRIES_ARE_VIEWS)
      public void testEntryViewReflectsRemove() {
        initThreeCopies();
        assertEquals(3, getMultiset().count(e0()));
        Multiset.Entry<E> entry = Iterables.getOnlyElement(getMultiset().entrySet());
        assertEquals(3, entry.getCount());
        assertTrue(getMultiset().remove(e0()));
        assertEquals(2, entry.getCount());
        assertTrue(getMultiset().elementSet().remove(e0()));
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Jan 09 20:10:38 GMT 2018
    - 9.6K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/collect/IterablesTest.java

        Iterable<String> iterable = Collections.singletonList("foo");
        assertEquals("foo", Iterables.getOnlyElement(iterable));
      }
    
      public void testGetOnlyElement_noDefault_empty() {
        Iterable<String> iterable = Collections.emptyList();
        try {
          Iterables.getOnlyElement(iterable);
          fail();
        } catch (NoSuchElementException expected) {
        }
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Mar 07 18:34:03 GMT 2024
    - 47.5K bytes
    - Viewed (0)
  4. android/guava-testlib/src/com/google/common/collect/testing/google/MultisetEntrySetTester.java

      @MultisetFeature.Require(ENTRIES_ARE_VIEWS)
      public void testEntryViewReflectsRemove() {
        initThreeCopies();
        assertEquals(3, getMultiset().count(e0()));
        Multiset.Entry<E> entry = Iterables.getOnlyElement(getMultiset().entrySet());
        assertEquals(3, entry.getCount());
        assertTrue(getMultiset().remove(e0()));
        assertEquals(2, entry.getCount());
        assertTrue(getMultiset().elementSet().remove(e0()));
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Jan 09 20:10:38 GMT 2018
    - 9.6K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/collect/IteratorsTest.java

      }
    
      public void testGetOnlyElement_withDefault_empty() {
        Iterator<String> iterator = Iterators.emptyIterator();
        assertEquals("bar", Iterators.getOnlyElement(iterator, "bar"));
      }
    
      public void testGetOnlyElement_withDefault_empty_null() {
        Iterator<String> iterator = Iterators.emptyIterator();
        assertNull(Iterators.<@Nullable String>getOnlyElement(iterator, null));
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Mar 07 18:34:03 GMT 2024
    - 55.7K bytes
    - Viewed (0)
  6. 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;
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Feb 27 19:19:19 GMT 2024
    - 17.1K bytes
    - Viewed (0)
  7. android/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 com.google.common.collect.testing.MapTestSuiteBuilder;
    import com.google.common.collect.testing.TestStringMapGenerator;
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Fri Feb 21 14:41:51 GMT 2020
    - 4.3K bytes
    - Viewed (0)
  8. 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 com.google.common.collect.testing.MapTestSuiteBuilder;
    import com.google.common.collect.testing.TestStringMapGenerator;
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Feb 09 21:08:15 GMT 2022
    - 5.2K bytes
    - Viewed (0)
  9. android/guava-testlib/src/com/google/common/collect/testing/google/MultimapAsMapTester.java

        resetContainer(Helpers.mapEntry(k0(), v0()), Helpers.mapEntry(k0(), v3()));
    
        Set<Entry<K, Collection<V>>> asMapEntrySet = multimap().asMap().entrySet();
        Collection<V> valueCollection = Iterables.getOnlyElement(asMapEntrySet).getValue();
        assertContentsAnyOrder(valueCollection, v0(), v3());
        assertTrue(multimap().put(k0(), v4()));
        assertContentsAnyOrder(valueCollection, v0(), v3(), v4());
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Jan 09 20:10:38 GMT 2018
    - 5.6K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/collect/ImmutableListCopyOfConcurrentlyModifiedInputTest.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.collect.Iterables.unmodifiableIterable;
    import static com.google.common.collect.Sets.newHashSet;
    import static com.google.common.reflect.Reflection.newProxy;
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Feb 22 20:09:59 GMT 2024
    - 6.6K bytes
    - Viewed (0)
Back to top