RemoteFetchEntryMessage extends RemoteOperationMessage { @Override protected boolean operateOnRegion(ClusterDistributionManager dm, LocalRegion r, long startTime) throws RemoteOperationException { r.waitOnInitialization(); EntrySnapshot val; try { final KeyInfo keyInfo = r.getKeyInfo(key); Region.Entry<?, ?> re = r.getDataView().getEntry(keyInfo, r, true); if (re == null) { r.checkEntryNotFound(key); } NonLocalRegionEntry nlre = new NonLocalRegionEntry(re, r); LocalRegion dataReg = r.getDataRegionForRead(keyInfo); val = new EntrySnapshot(nlre, dataReg, r, false); FetchEntryReplyMessage.send(getSender(), getProcessorId(), val, dm, null); } catch (TransactionException tex) { FetchEntryReplyMessage.send(getSender(), getProcessorId(), null, dm, new ReplyException(tex)); } catch (EntryNotFoundException enfe) { FetchEntryReplyMessage.send(getSender(), getProcessorId(), null, dm, new ReplyException( "entry not found", enfe)); } return false; } RemoteFetchEntryMessage(); private  RemoteFetchEntryMessage(InternalDistributedMember recipient, String regionPath,
      ReplyProcessor21 processor, final Object key); static FetchEntryResponse send(InternalDistributedMember recipient, LocalRegion r,
      final Object key); @Override int getDSFID(); @Override void fromData(DataInput in,
      DeserializationContext context); @Override void toData(DataOutput out,
      SerializationContext context); void setKey(Object key);  }
@Test public void shouldBeMockable() throws Exception { RemoteFetchEntryMessage mockRemoteFetchEntryMessage = mock(RemoteFetchEntryMessage.class); ClusterDistributionManager mockDistributionManager = mock(ClusterDistributionManager.class); LocalRegion mockLocalRegion = mock(LocalRegion.class); long startTime = System.currentTimeMillis(); when(mockRemoteFetchEntryMessage.operateOnRegion(eq(mockDistributionManager), eq(mockLocalRegion), eq(startTime))).thenReturn(true); assertThat(mockRemoteFetchEntryMessage.operateOnRegion(mockDistributionManager, mockLocalRegion, startTime)).isTrue(); }