@Test
  public void testLegalMapMods() {
    LinkedHashMap<String, String> m = new LinkedHashMap<>();
    m.put("1", "1");
    m.put("2", "2");
    m.put("3", "3");
    PutAllOperationContext paoc = new PutAllOperationContext(m);
    Map<String, String> opMap = paoc.getMap();
    assertEquals(m, opMap);

    { // change order and make sure paoc map order is unchanged
      LinkedHashMap<String, String> m2 = new LinkedHashMap<>();
      m2.put("3", "3");
      m2.put("1", "1");
      m2.put("2", "2");
      paoc.setMap(m2);
      assertEquals(Arrays.asList("1", "2", "3"), new ArrayList<>(opMap.keySet()));
      assertEquals(m, opMap);
    }
    assertEquals(false, opMap.isEmpty());
    assertEquals(3, opMap.size());
    assertEquals(true, opMap.containsKey("1"));
    assertEquals(false, opMap.containsKey("4"));
    assertEquals("1", opMap.get("1"));
    assertEquals(Arrays.asList("1", "2", "3"), new ArrayList<>(opMap.values()));
    opMap.put("1", "1b");
    opMap.put("2", "2b");
    opMap.put("3", "3b");
    m = new LinkedHashMap<>();
    m.put("1", "1b");
    m.put("2", "2b");
    m.put("3", "3b");
    assertEquals(m, opMap);
    m.put("2", "2c");
    paoc.setMap(m);
    assertEquals(m, opMap);
    for (Map.Entry<String, String> me : opMap.entrySet()) {
      if (me.getKey().equals("1")) {
        me.setValue("1d");
      }
    }
    m.put("1", "1d");
    assertEquals(m, opMap);

    paoc.setMap(opMap);

    // check that none of updates changed to key order
    assertEquals(Arrays.asList("1", "2", "3"), new ArrayList<>(opMap.keySet()));

    opMap.toString();
  }
Make sure that we do not expose the internal CachedDeserializable to customers
geode-core/src/test/java/org/apache/geode/internal/PutAllOperationContextJUnitTest.java