assertSizeEventually(0, map);
assertHeapCostsZeroEventually(mapName, instances);
}
private void assertHeapCostsZeroEventually(final String mapName, final HazelcastInstance... nodes) {
assertTrueEventually(new AssertTask() {
@Override
public void run() throws Exception {
for (HazelcastInstance node : nodes) {
final long heapCostOfNode = node.getMap(mapName).getLocalMapStats().getHeapCost();
assertEquals(0L, heapCostOfNode);