コード例 #1
0
 @Override
 @Test
 public void retainAllFromEntrySet() {
   MutableSortedMap<Integer, String> map = this.newMapWithKeysValues(1, "1", 2, "Two");
   Verify.assertThrows(
       UnsupportedOperationException.class,
       () -> map.entrySet().retainAll(FastList.newListWith(ImmutableEntry.of(2, "Two"))));
 }
コード例 #2
0
 @Test
 public void entrySetToArrayWithTarget() {
   MutableSortedMap<Integer, String> map = this.newMapWithKeyValue(1, "One").asUnmodifiable();
   Object[] entries = map.entrySet().toArray(new Object[] {});
   Assert.assertEquals(ImmutableEntry.of(1, "One"), entries[0]);
 }