@Override public RichIterable<Pair<K, V>> keyValuesView() { synchronized (this.lock) { Set<Entry<K, V>> entries = this.getDelegate().entrySet(); Iterable<Pair<K, V>> pairs = Iterate.collect(entries, AbstractImmutableEntry.getPairFunction()); return LazyIterate.adapt(pairs); } }
@Override public RichIterable<Pair<K, V>> keyValuesView() { synchronized (this.lock) { Set<Entry<K, V>> entries = this.getDelegate().entrySet(); Iterable<Pair<K, V>> pairs = Iterate.collect(entries, AbstractImmutableEntry.getPairFunction()); return LazyIterate.adapt(pairs); } }
int entrySetSize = mutableMapIterable.entrySet().size(); if (entrySetSize != expectedSize)
/** * Assert that the given {@link MutableMapIterable} is <em>not</em> empty. */ public static void assertNotEmpty(String mutableMapIterableName, MutableMapIterable<?, ?> actualMutableMapIterable) { try { Verify.assertObjectNotNull(mutableMapIterableName, actualMutableMapIterable); Assert.assertFalse(mutableMapIterableName + " should be non-empty, but was empty", Iterate.isEmpty(actualMutableMapIterable)); Assert.assertTrue(mutableMapIterableName + " should be non-empty, but was empty", Iterate.notEmpty(actualMutableMapIterable)); Assert.assertTrue(mutableMapIterableName + " should be non-empty, but was empty", actualMutableMapIterable.notEmpty()); Assert.assertNotEquals(mutableMapIterableName + " should be non-empty, but was empty", 0, actualMutableMapIterable.size()); Assert.assertNotEquals(mutableMapIterableName + " should be non-empty, but was empty", 0, actualMutableMapIterable.keySet().size()); Assert.assertNotEquals(mutableMapIterableName + " should be non-empty, but was empty", 0, actualMutableMapIterable.values().size()); Assert.assertNotEquals(mutableMapIterableName + " should be non-empty, but was empty", 0, actualMutableMapIterable.entrySet().size()); } catch (AssertionError e) { Verify.throwMangledException(e); } }
@Override public RichIterable<Pair<K, V>> keyValuesView() { synchronized (this.lock) { Set<Entry<K, V>> entries = this.getDelegate().entrySet(); Iterable<Pair<K, V>> pairs = Iterate.collect(entries, AbstractImmutableEntry.getPairFunction()); return LazyIterate.adapt(pairs); } }
int entrySetSize = mutableMapIterable.entrySet().size(); if (entrySetSize != expectedSize)
/** * Assert that the given {@link MutableMapIterable} is <em>not</em> empty. */ public static void assertNotEmpty(String mutableMapIterableName, MutableMapIterable<?, ?> actualMutableMapIterable) { try { Verify.assertObjectNotNull(mutableMapIterableName, actualMutableMapIterable); Assert.assertFalse(mutableMapIterableName + " should be non-empty, but was empty", Iterate.isEmpty(actualMutableMapIterable)); Assert.assertTrue(mutableMapIterableName + " should be non-empty, but was empty", Iterate.notEmpty(actualMutableMapIterable)); Assert.assertTrue(mutableMapIterableName + " should be non-empty, but was empty", actualMutableMapIterable.notEmpty()); Assert.assertNotEquals(mutableMapIterableName + " should be non-empty, but was empty", 0, actualMutableMapIterable.size()); Assert.assertNotEquals(mutableMapIterableName + " should be non-empty, but was empty", 0, actualMutableMapIterable.keySet().size()); Assert.assertNotEquals(mutableMapIterableName + " should be non-empty, but was empty", 0, actualMutableMapIterable.values().size()); Assert.assertNotEquals(mutableMapIterableName + " should be non-empty, but was empty", 0, actualMutableMapIterable.entrySet().size()); } catch (AssertionError e) { Verify.throwMangledException(e); } }