@Override
  public int entryCount(LocalRegion localRegion) {
    int result = localRegion.getRegionSize();
    TXRegionState txr = txReadRegion(localRegion);
    if (txr != null) {
      result += txr.entryCountMod();
    }
    if (result > 0) {
      return result;
    } else {
      // This is to work around bug #40946.
      // Other threads can destroy all the keys, and so our entryModCount
      // can bring us below 0
      return 0;
    }
  }
This form of txReadEntry takes a concurrent-map argument, expectedOldValue. If this parameter
is not null it must match the current value of the entry or an EntryNotFoundException is
thrown.
geode-core/src/main/java/org/apache/geode/internal/cache/TXState.java