title: What is the proper way to remove an element from a Hazelcast Map?
body: <p>I need to remove an item from Hazelcast distributed Map and I use something like this code (simplified): </p>
  
  <pre><code>  public void realeaseBatchesById(int Id) {
  
      Iterator&lt;Map.Entry&lt;Long, WorkingBatch&gt;&gt; it = workingMap.entrySet().iterator();
  
      while (it.hasNext()) {
          WorkingBatch value = it.next().getValue();
          if (value.getServer().getId() == idd) {
          it.remove();
          }
      }
  
      }
  </code></pre>
  
  <p>but this code doesn't remove value, the size of the map is the same at the beginning as the size at the end. </p>
  
  <p>When I see to <a href="http://hazelcast.org/docs/latest/javadoc/com/hazelcast/core/IMap.html" rel="nofollow">Hazelcast Javadoc</a> I see that this interface defines only removing by key and by key with value. Does it mean I cannot use standard way how to remove value from the map?</p>