TXRegionLockRequestImpl implements TXRegionLockRequest { @Override public Map<Object, Boolean> getKeys() { if (this.entryKeys == null) { cache.getCancelCriterion().checkCancelInProgress(null); } return this.entryKeys; } TXRegionLockRequestImpl();  TXRegionLockRequestImpl(InternalCache cache, InternalRegion r); @VisibleForTesting  TXRegionLockRequestImpl(String regionPath, Map<Object, Boolean> entryKeys); boolean isEmpty(); @Override void addEntryKeys(Map<Object, Boolean> map); @Override void addEntryKey(Object key, Boolean isEvent); @Override void fromData(DataInput in); @Override void toData(DataOutput out); static TXRegionLockRequestImpl createFromData(DataInput in); @Override String getRegionFullPath(); @Override Map<Object, Boolean> getKeys(); InternalRegion getLocalRegion(); @Override String toString();  }
@Test public void getKeysThrowsCancelExceptionIfCacheIsClosed() { TXRegionLockRequestImpl txRegionLockRequest = new TXRegionLockRequestImpl(cache, region); assertThatThrownBy(() -> txRegionLockRequest.getKeys()).isInstanceOf(CancelException.class); }