### Question:
AbstractCacheProvidingService implements PentahoCacheProvidingService { @Override public <K, V> CompleteConfiguration<K, V> createConfiguration( Class<K> keyType, Class<V> valueType, Map<String, String> properties ) { MutableConfiguration<K, V> configuration = new MutableConfiguration<K, V>(); configuration.setTypes( keyType, valueType ); if ( properties.containsKey( CONFIG_TTL ) ) { Long ttl = Longs.tryParse( Strings.nullToEmpty( properties.get( CONFIG_TTL ) ) ); Preconditions.checkArgument( ttl != null, "Template config error", CONFIG_TTL ); Optional<ExpiryFunction> expiryFunction; if ( properties.containsKey( CONFIG_TTL_RESET ) ) { expiryFunction = Enums.getIfPresent( ExpiryFunction.class, properties.get( CONFIG_TTL_RESET ) ); } else { expiryFunction = Optional.of( CONFIG_TTL_RESET_DEFAULT ); } Preconditions.checkArgument( expiryFunction.isPresent(), "Template config error", CONFIG_TTL_RESET ); configuration.setExpiryPolicyFactory( expiryFunction.get().createFactory( ttl ) ); } if ( properties.containsKey( CONFIG_STORE_BY_VALUE ) ) { configuration.setStoreByValue( Boolean.valueOf( properties.get( CONFIG_STORE_BY_VALUE ) ) ); } return configuration; }  @Override CompleteConfiguration<K, V> createConfiguration( Class<K> keyType, Class<V> valueType,
                                                                           Map<String, String> properties );  }### Answer:
@Test public void testCreateConfiguration() throws Exception { CompleteConfiguration<String, List> configuration = service.createConfiguration( String.class, List.class, ImmutableMap.<String, String>builder(). put( Constants.CONFIG_TTL, String.valueOf( 60 * 2 ) ). put( Constants.CONFIG_TTL_RESET, Constants.ExpiryFunction.ACCESS.name() ). put( Constants.CONFIG_STORE_BY_VALUE, "false" ). build() ); assertThat( configuration.getKeyType(), Matchers.<Class>equalTo( String.class ) ); assertThat( configuration.getValueType(), Matchers.<Class>equalTo( List.class ) ); assertFalse( configuration.isStoreByValue() ); ExpiryPolicy expiryPolicy = configuration.getExpiryPolicyFactory().create(); assertThat( expiryPolicy, instanceOf( AccessedExpiryPolicy.class ) ); assertThat( expiryPolicy.getExpiryForAccess(), equalTo( new Duration( TimeUnit.MINUTES, 2 ) ) ); assertThat( expiryPolicy.getExpiryForUpdate(), nullValue() ); }