### Question:
CollectionMemcachedRegion extends TransactionalDataMemcachedRegion implements CollectionRegion { @Override public CollectionRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException { switch (accessType) { case READ_ONLY: return new ReadOnlyCollectionRegionAccessStrategy(this); case NONSTRICT_READ_WRITE: return new NonstrictReadWriteCollectionRegionAccessStrategy(this); default: throw new CacheException("Unsupported access strategy : " + accessType + "."); } } CollectionMemcachedRegion(String regionName, OverridableReadOnlyProperties properties, CacheDataDescription metadata, Settings settings, MemcachedAdapter memcachedAdapter, HibernateCacheTimestamper hibernateCacheTimestamper); @Override CollectionRegionAccessStrategy buildAccessStrategy(AccessType accessType);  }### Answer:
@Test public void buildAccessStrategy_AccessType_READ_ONLY() throws Exception { assertThat(collectionMemcachedRegion.buildAccessStrategy(AccessType.READ_ONLY)) .isExactlyInstanceOf(ReadOnlyCollectionRegionAccessStrategy.class); }
@Test public void buildAccessStrategy_AccessType_NONSTRICT_READ_WRITE() throws Exception { assertThat(collectionMemcachedRegion.buildAccessStrategy(AccessType.NONSTRICT_READ_WRITE)) .isExactlyInstanceOf(NonstrictReadWriteCollectionRegionAccessStrategy.class); }
@Test public void buildAccessStrategy_AccessType_READ_WRITE() throws Exception { expectedException.expect(CacheException.class); expectedException.expectMessage(containsString(AccessType.READ_WRITE.toString())); collectionMemcachedRegion.buildAccessStrategy(AccessType.READ_WRITE); }
@Test public void buildAccessStrategy_AccessType_TRANSACTIONAL() throws Exception { expectedException.expect(CacheException.class); expectedException.expectMessage(containsString(AccessType.TRANSACTIONAL.toString())); collectionMemcachedRegion.buildAccessStrategy(AccessType.TRANSACTIONAL); }