[Demonstration 1]

[Buggy Method]
protected Cache buildCache(CacheAnnoConfig cacheAnnoConfig, String area, String fullCacheName) {
    Cache cache;
    if (cacheAnnoConfig.getCacheType() == CacheType.LOCAL) {
        cache = buildLocal(cacheAnnoConfig, area);
    } else if (cacheAnnoConfig.getCacheType() == CacheType.REMOTE) {
        cache = buildRemote(cacheAnnoConfig, area, fullCacheName);
    } else {
        Cache local = buildLocal(cacheAnnoConfig, area);
        Cache remote = buildRemote(cacheAnnoConfig, area, fullCacheName);
        if (defaultCacheMonitorManager != null) {
            DefaultCacheMonitor localMonitor = new DefaultCacheMonitor(fullCacheName + "_local");
            local.config().getMonitors().add(localMonitor);
            DefaultCacheMonitor remoteMonitor = new DefaultCacheMonitor(fullCacheName + "_remote");
            remote.config().getMonitors().add(remoteMonitor);
            defaultCacheMonitorManager.add(localMonitor, remoteMonitor);
        }
        cache = MultiLevelCacheBuilder.createMultiLevelCacheBuilder().expireAfterWrite(cacheAnnoConfig.getExpire(), cacheAnnoConfig.getTimeUnit()).addCache(local, remote).buildCache();
    }
    cache = new RefreshCache(cache);
    if (defaultCacheMonitorManager != null) {
        DefaultCacheMonitor monitor = new DefaultCacheMonitor(fullCacheName);
        cache.config().getMonitors().add(monitor);
        defaultCacheMonitorManager.add(monitor);
    }
    return cache;
}

[Buggy Hunk]
.expireAfterWrite(cacheAnnoConfig.getExpire(), cacheAnnoConfig.getTimeUnit())

[Patch]
.expireAfterWrite(local.config().getExpireAfterWriteInMillis(), TimeUnit.MILLISECONDS)

[Demonstration 2]

[Buggy Method]
<K, V> HiDensityNearCacheSupportContext<K, V> createHiDensityCacheWithHiDensityNearCache(String cacheName, NearCacheConfig nearCacheConfig) {
    ClientConfig clientConfig = createClientConfig();
    clientConfig.addNearCacheConfig(nearCacheConfig);
    HazelcastClientProxy client = (HazelcastClientProxy) HazelcastClient.newHazelcastClient(clientConfig);
    CachingProvider provider = HazelcastClientCachingProvider.createCachingProvider(client);
    HazelcastClientCacheManager cacheManager = (HazelcastClientCacheManager) provider.getCacheManager();
    CacheConfig<K, V> cacheConfig = createCacheConfig(nearCacheConfig.getInMemoryFormat());
    ICache<K, V> cache = cacheManager.createCache(cacheName, cacheConfig);
    clients.add(client);
    EnterpriseSerializationService enterpriseSerializationService = (EnterpriseSerializationService) client.getSerializationService();
    return new HiDensityNearCacheSupportContext(cache, enterpriseSerializationService.getMemoryManager());
}

[Buggy Hunk]
return new HiDensityNearCacheSupportContext(cache, enterpriseSerializationService.getMemoryManager());

[Patch]
return new HiDensityNearCacheSupportContext<K, V>(cache, enterpriseSerializationService.getMemoryManager());

[Demonstration 3]

[Buggy Method]
public static String defaultPath() {
    String sep = StandardSystemProperty.FILE_SEPARATOR.value();
    String userDir = StandardSystemProperty.USER_DIR.value();
    return userDir + sep + "lucene" + sep + "data" + sep + "index";
}

[Buggy Hunk]
return userDir+sep+"lucene"+sep+"data"+sep+"index";

[Patch]
return userDir+sep+"lucene"+sep+"collection1"+sep+"data"+sep+"index";