### Question:
MemcachedRegionAccessStrategy implements RegionAccessStrategy { @Override public boolean putFromLoad(Object key, Object value, long txTimestamp, Object version) throws CacheException { return putFromLoad(key, value, txTimestamp, version, isMinimalPutsEnabled()); } MemcachedRegionAccessStrategy(GeneralDataMemcachedRegion internalRegion); @Override Object get(Object key, long txTimestamp); @Override boolean putFromLoad(Object key, Object value, long txTimestamp, Object version); @Override boolean putFromLoad(Object key, Object value, long txTimestamp, Object version, boolean minimalPutOverride); @Override SoftLock lockItem(Object key, Object version); @Override SoftLock lockRegion(); @Override void unlockItem(Object key, SoftLock lock); @Override void unlockRegion(SoftLock lock); @Override void remove(Object key); @Override void removeAll(); @Override void evict(Object key); @Override void evictAll(); boolean isMinimalPutsEnabled();  }### Answer:
@Test public void putFromLoad_without_minimalPutOverride() throws Exception { Settings settings = new TestingSettingsBuilder().setField("minimalPutsEnabled", true).build(); when(generalDataMemcachedRegion.getSettings()).thenReturn(settings); memcachedRegionAccessStrategy.putFromLoad("books#1", "book 1", 1L, "version object"); verify(memcachedRegionAccessStrategy).putFromLoad("books#1", "book 1", 1L, "version object", true); }
@Test public void putFromLoad_key_value_null() throws Exception { for (String key : new String[] {null, "books#1"}) { for (String value : new String [] {null, "cache value"}) { if (key == null || value == null) { assertThat(memcachedRegionAccessStrategy.putFromLoad(key, value, 1L, "version object", false)).isFalse(); } else { assertThat(memcachedRegionAccessStrategy.putFromLoad(key, value, 1L, "version object", false)).isTrue(); } } } }
@Test public void putFromLoad() throws Exception { boolean actual = memcachedRegionAccessStrategy.putFromLoad("greeting key", "hello value", 1L, "version object", true); assertThat(actual).isTrue(); verify(generalDataMemcachedRegion).put("greeting key", "hello value"); }