@Test
public void build() {

  assertTrue(new SpringCacheBuilder("heap").build() instanceof HeapCache);
  SpringCacheBuilder builder = new SpringCacheBuilder();
  builder.setType("heap");
  assertTrue(builder.build() instanceof HeapCache);
  builder.setType("redis");
  builder.setConcurrencyLevel(2);
  builder.setCacheLoader(key -> null);
  builder.setEvictionListener((key, value) -> {
  });
  builder.setIndexHandler(new DefaultIndexHandler<>());
  builder.setRedisHost("localhost");
  builder.setRedisPort(6379);
  builder.setSerializer(new Serializer<Object>() {
    @Override
    public byte[] serialize(Object value) {
      return value.toString().getBytes();
    }
    @Override
    public Object deserialize(byte[] payload) {
      return new String(payload);
    }
  });
  assertTrue(builder.build() instanceof RedisCache);
  builder.setType("offheap");
  builder.setEvictionPeriod(2);
  builder.setHeapCapacity(19999);
  builder.setBufferCleanerPeriod(1000);
  builder.setBufferCleanerThreshold(0.6F);
  OffHeapByteBufferStore bufferStore = new OffHeapByteBufferStore(8388608, 2);
  builder.setBufferStore(bufferStore);
  assertTrue(builder.build("off-heap") instanceof OffHeapCache);
  builder.setType("versioned_offheap");
  assertTrue(builder.build() instanceof VersionedOffHeapCache);
}