nus-yam/ex-repair huggingface dataset:
Program: 19391
Project: 19391
Buggy source:
@Test public void get_WithNonKeyKey(){
  ArrayList<Integer> key1=new ArrayList<Integer>();
  key1.add(1);
  key1.add(2);
  LinkedList<Integer> key2=new LinkedList<Integer>(key1);
  CacheLoader<ArrayList<Integer>,String> loader=new ArrayListCacheLoader();
  Cache<ArrayList<Integer>,String> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<ArrayList<Integer>,String>().setCacheLoader(loader));
}

Fixed version (ground truth):
@Test public void get_WithNonKeyKey(){
  ArrayList<Integer> key1=new ArrayList<Integer>();
  key1.add(1);
  key1.add(2);
  LinkedList<Integer> key2=new LinkedList<Integer>(key1);
  CacheLoader<ArrayList<Integer>,String> loader=new ArrayListCacheLoader();
  Cache<ArrayList<Integer>,String> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<ArrayList<Integer>,String>().setCacheLoaderFactory(Factories.of(loader)));
}
Program: 19392
Project: 19392
Buggy source:
@Test public void replace_3arg_Different(){
  SimpleCacheLoader<Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoader(loader));
  Integer key=1;
  Integer value1=key + 1;
  Integer value2=value1 + 1;
  Integer value3=value2 + 1;
  cache.put(key,value1);
  assertFalse(cache.replace(key,value2,value3));
  assertEquals(value1,cache.get(key));
}

Fixed version (ground truth):
@Test public void replace_3arg_Different(){
  SimpleCacheLoader<Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(loader)));
  Integer key=1;
  Integer value1=key + 1;
  Integer value2=value1 + 1;
  Integer value3=value2 + 1;
  cache.put(key,value1);
  assertFalse(cache.replace(key,value2,value3));
  assertEquals(value1,cache.get(key));
}
Program: 19393
Project: 19393
Buggy source:
@Test public void loadAll_NullValue() throws Exception {
  CacheLoader<Integer,Integer> loader=new MockCacheLoader<Integer,Integer>(){
    @Override public Map<Integer,Integer> loadAll(    Iterable<? extends Integer> keys){
      Map<Integer,Integer> map=new HashMap<Integer,Integer>();
      for (      Integer key : keys) {
        map.put(key,null);
      }
      return map;
    }
  }
;
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoader(loader));
  HashSet<Integer> keys=new HashSet<Integer>();
  keys.add(1);
  keys.add(2);
  CompletionListenerFuture future=new CompletionListenerFuture();
  cache.loadAll(keys,future);
  try {
    future.get(FUTURE_WAIT_MILLIS,TimeUnit.MILLISECONDS);
    assertTrue(future.isDone());
    fail("String_Node_Str");
  }
 catch (  ExecutionException e) {
    assertTrue(e.getCause() instanceof NullPointerException);
  }
}

Fixed version (ground truth):
@Test public void loadAll_NullValue() throws Exception {
  CacheLoader<Integer,Integer> loader=new MockCacheLoader<Integer,Integer>(){
    @Override public Map<Integer,Integer> loadAll(    Iterable<? extends Integer> keys){
      Map<Integer,Integer> map=new HashMap<Integer,Integer>();
      for (      Integer key : keys) {
        map.put(key,null);
      }
      return map;
    }
  }
;
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(loader)));
  HashSet<Integer> keys=new HashSet<Integer>();
  keys.add(1);
  keys.add(2);
  CompletionListenerFuture future=new CompletionListenerFuture();
  cache.loadAll(keys,future);
  try {
    future.get(FUTURE_WAIT_MILLIS,TimeUnit.MILLISECONDS);
    assertTrue(future.isDone());
    fail("String_Node_Str");
  }
 catch (  ExecutionException e) {
    assertTrue(e.getCause() instanceof NullPointerException);
  }
}
Program: 19394
Project: 19394
Buggy source:
@Test public void replace_3arg_Missing(){
  SimpleCacheLoader<Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoader(loader));
  Integer key=1;
  Integer newValue=key + 1;
  assertFalse(cache.replace(key,key,newValue));
  assertFalse(cache.containsKey(key));
}

Fixed version (ground truth):
@Test public void replace_3arg_Missing(){
  SimpleCacheLoader<Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(loader)));
  Integer key=1;
  Integer newValue=key + 1;
  assertFalse(cache.replace(key,key,newValue));
  assertFalse(cache.containsKey(key));
}
Program: 19395
Project: 19395
Buggy source:
@Test public void getAll(){
  SimpleCacheLoader<Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoader(loader));
  HashSet<Integer> keysToGet=new HashSet<Integer>();
  keysToGet.add(1);
  keysToGet.add(2);
  keysToGet.add(3);
  Map<Integer,Integer> map=cache.getAll(keysToGet);
  assertEquals(keysToGet.size(),map.size());
  for (  Integer key : keysToGet) {
    assertTrue(map.containsKey(key));
    assertEquals(cache.get(key),map.get(key));
    assertEquals(key,map.get(key));
  }
  for (  Integer key : keysToGet) {
    assertTrue(cache.containsKey(key));
  }
}

Fixed version (ground truth):
@Test public void getAll(){
  SimpleCacheLoader<Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(loader)));
  HashSet<Integer> keysToGet=new HashSet<Integer>();
  keysToGet.add(1);
  keysToGet.add(2);
  keysToGet.add(3);
  Map<Integer,Integer> map=cache.getAll(keysToGet);
  assertEquals(keysToGet.size(),map.size());
  for (  Integer key : keysToGet) {
    assertTrue(map.containsKey(key));
    assertEquals(cache.get(key),map.get(key));
    assertEquals(key,map.get(key));
  }
  for (  Integer key : keysToGet) {
    assertTrue(cache.containsKey(key));
  }
}
Program: 19396
Project: 19396
Buggy source:
@Test public void load_DefaultCacheLoader() throws Exception {
  CacheLoader<Integer,Integer> clDefault=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoader(clDefault));
  Integer key=123;
  CompletionListenerFuture future=new CompletionListenerFuture();
  cache.loadAll(Collections.singleton(key),future);
  future.get(FUTURE_WAIT_MILLIS,TimeUnit.MILLISECONDS);
  assertTrue(future.isDone());
  assertTrue(cache.containsKey(key));
  assertEquals(key,cache.get(key));
}

Fixed version (ground truth):
@Test public void load_DefaultCacheLoader() throws Exception {
  CacheLoader<Integer,Integer> clDefault=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(clDefault)));
  Integer key=123;
  CompletionListenerFuture future=new CompletionListenerFuture();
  cache.loadAll(Collections.singleton(key),future);
  future.get(FUTURE_WAIT_MILLIS,TimeUnit.MILLISECONDS);
  assertTrue(future.isDone());
  assertTrue(cache.containsKey(key));
  assertEquals(key,cache.get(key));
}
Program: 19397
Project: 19397
Buggy source:
@Test public void loadAll_NullKey() throws Exception {
  CacheLoader<Integer,Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoader(loader));
  HashSet<Integer> keys=new HashSet<Integer>();
  keys.add(null);
  try {
    CompletionListenerFuture future=new CompletionListenerFuture();
    cache.loadAll(keys,future);
    future.get(FUTURE_WAIT_MILLIS,TimeUnit.MILLISECONDS);
    assertTrue(future.isDone());
    fail("String_Node_Str");
  }
 catch (  ExecutionException e) {
    assertTrue(e.getCause() instanceof NullPointerException);
  }
}

Fixed version (ground truth):
@Test public void loadAll_NullKey() throws Exception {
  CacheLoader<Integer,Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(loader)));
  HashSet<Integer> keys=new HashSet<Integer>();
  keys.add(null);
  try {
    CompletionListenerFuture future=new CompletionListenerFuture();
    cache.loadAll(keys,future);
    future.get(FUTURE_WAIT_MILLIS,TimeUnit.MILLISECONDS);
    assertTrue(future.isDone());
    fail("String_Node_Str");
  }
 catch (  ExecutionException e) {
    assertTrue(e.getCause() instanceof NullPointerException);
  }
}
Program: 19398
Project: 19398
Buggy source:
@Test public void containsKey(){
  SimpleCacheLoader<Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoader(loader));
  Integer key=1;
  assertFalse(cache.containsKey(key));
  assertEquals(key,cache.get(key));
  assertTrue(cache.containsKey(key));
}

Fixed version (ground truth):
@Test public void containsKey(){
  SimpleCacheLoader<Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(loader)));
  Integer key=1;
  assertFalse(cache.containsKey(key));
  assertEquals(key,cache.get(key));
  assertTrue(cache.containsKey(key));
}
Program: 19399
Project: 19399
Buggy source:
@Test public void getAndRemove_There(){
  SimpleCacheLoader<Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoader(loader));
  Integer key=1;
  Integer value=key + 1;
  cache.put(key,value);
  assertEquals(value,cache.getAndRemove(key));
  assertFalse(cache.containsKey(key));
}

Fixed version (ground truth):
@Test public void getAndRemove_There(){
  SimpleCacheLoader<Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(loader)));
  Integer key=1;
  Integer value=key + 1;
  cache.put(key,value);
  assertEquals(value,cache.getAndRemove(key));
  assertFalse(cache.containsKey(key));
}
Program: 19400
Project: 19400
Buggy source:
@Test public void replace_3arg(){
  SimpleCacheLoader<Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoader(loader));
  Integer key=1;
  Integer value1=key + 1;
  Integer value2=value1 + 1;
  Integer value3=value2 + 1;
  cache.put(key,value2);
  assertTrue(cache.replace(key,value2,value3));
  assertEquals(value3,cache.get(key));
}

Fixed version (ground truth):
@Test public void replace_3arg(){
  SimpleCacheLoader<Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(loader)));
  Integer key=1;
  Integer value1=key + 1;
  Integer value2=value1 + 1;
  Integer value3=value2 + 1;
  cache.put(key,value2);
  assertTrue(cache.replace(key,value2,value3));
  assertEquals(value3,cache.get(key));
}
Program: 19401
Project: 19401
Buggy source:
@Test public void get_Stored(){
  SimpleCacheLoader<Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoader(loader));
  Integer key=1;
  assertFalse(cache.containsKey(key));
  assertEquals(key,cache.get(key));
  assertTrue(cache.containsKey(key));
}

Fixed version (ground truth):
@Test public void get_Stored(){
  SimpleCacheLoader<Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(loader)));
  Integer key=1;
  assertFalse(cache.containsKey(key));
  assertEquals(key,cache.get(key));
  assertTrue(cache.containsKey(key));
}
Program: 19402
Project: 19402
Buggy source:
@Test public void getAndReplace(){
  SimpleCacheLoader<Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoader(loader));
  Integer key=1;
  Integer newValue=key + 1;
  assertNull(cache.getAndReplace(key,newValue));
  assertFalse(cache.containsKey(key));
}

Fixed version (ground truth):
@Test public void getAndReplace(){
  SimpleCacheLoader<Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(loader)));
  Integer key=1;
  Integer newValue=key + 1;
  assertNull(cache.getAndReplace(key,newValue));
  assertFalse(cache.containsKey(key));
}
Program: 19403
Project: 19403
Buggy source:
@Test public void replace_2arg_Missing(){
  SimpleCacheLoader<Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoader(loader));
  Integer key=1;
  assertFalse(cache.replace(key,key));
  assertFalse(cache.containsKey(key));
}

Fixed version (ground truth):
@Test public void replace_2arg_Missing(){
  SimpleCacheLoader<Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(loader)));
  Integer key=1;
  assertFalse(cache.replace(key,key));
  assertFalse(cache.containsKey(key));
}
Program: 19404
Project: 19404
Buggy source:
@Test public void get_Exception(){
  CacheLoader<Integer,Integer> loader=new MockCacheLoader<Integer,Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoader(loader));
  Integer key=1;
  try {
    cache.get(key);
    fail("String_Node_Str");
  }
 catch (  UnsupportedOperationException e) {
  }
}

Fixed version (ground truth):
@Test public void get_Exception(){
  CacheLoader<Integer,Integer> loader=new MockCacheLoader<Integer,Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(loader)));
  Integer key=1;
  try {
    cache.get(key);
    fail("String_Node_Str");
  }
 catch (  UnsupportedOperationException e) {
  }
}
Program: 19405
Project: 19405
Buggy source:
@Test public void loadAll_ExceptionPropagation() throws Exception {
  final RuntimeException expectedException=new RuntimeException("String_Node_Str");
  CacheLoader<Integer,Integer> loader=new MockCacheLoader<Integer,Integer>(){
    @Override public Map<Integer,Integer> loadAll(    Iterable<? extends Integer> keys){
      throw expectedException;
    }
  }
;
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoader(loader));
  HashSet<Integer> keys=new HashSet<Integer>();
  keys.add(1);
  CompletionListenerFuture future=new CompletionListenerFuture();
  cache.loadAll(keys,future);
  try {
    future.get(FUTURE_WAIT_MILLIS,TimeUnit.MILLISECONDS);
    fail("String_Node_Str");
  }
 catch (  ExecutionException e) {
    assertTrue(future.isDone());
    assertEquals(expectedException,e.getCause());
  }
}

Fixed version (ground truth):
@Test public void loadAll_ExceptionPropagation() throws Exception {
  final RuntimeException expectedException=new RuntimeException("String_Node_Str");
  CacheLoader<Integer,Integer> loader=new MockCacheLoader<Integer,Integer>(){
    @Override public Map<Integer,Integer> loadAll(    Iterable<? extends Integer> keys){
      throw expectedException;
    }
  }
;
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(loader)));
  HashSet<Integer> keys=new HashSet<Integer>();
  keys.add(1);
  CompletionListenerFuture future=new CompletionListenerFuture();
  cache.loadAll(keys,future);
  try {
    future.get(FUTURE_WAIT_MILLIS,TimeUnit.MILLISECONDS);
    fail("String_Node_Str");
  }
 catch (  ExecutionException e) {
    assertTrue(future.isDone());
    assertEquals(expectedException,e.getCause());
  }
}
Program: 19406
Project: 19406
Buggy source:
@Test public void putIfAbsent(){
  SimpleCacheLoader<Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoader(loader));
  Integer key=1;
  Integer value=key + 1;
  assertTrue(cache.putIfAbsent(key,value));
  assertEquals(value,cache.get(key));
}

Fixed version (ground truth):
@Test public void putIfAbsent(){
  SimpleCacheLoader<Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(loader)));
  Integer key=1;
  Integer value=key + 1;
  assertTrue(cache.putIfAbsent(key,value));
  assertEquals(value,cache.get(key));
}
Program: 19407
Project: 19407
Buggy source:
@Before public void setup(){
  cacheWriter=new RecordingCacheWriter<Integer,String>();
  MutableConfiguration<Integer,String> config=new MutableConfiguration<Integer,String>();
  config.setCacheWriter(cacheWriter);
  config.setWriteThrough(true);
  cache=getCacheManager().configureCache(getTestCacheName(),config);
}

Fixed version (ground truth):
@Before public void setup(){
  cacheWriter=new RecordingCacheWriter<Integer,String>();
  MutableConfiguration<Integer,String> config=new MutableConfiguration<Integer,String>();
  config.setCacheWriterFactory(Factories.of(cacheWriter));
  config.setWriteThrough(true);
  cache=getCacheManager().configureCache(getTestCacheName(),config);
}
Program: 19408
Project: 19408
Buggy source:
@Test public void checkDefaults(){
  Configuration<?,?> config=getConfiguration();
  assertFalse(config.isReadThrough());
  assertFalse(config.isWriteThrough());
  assertFalse(config.isStatisticsEnabled());
  assertTrue(config.isStoreByValue());
  Duration duration=new Duration(TimeUnit.MINUTES,10);
  assertEquals(Duration.ETERNAL,config.getExpiryPolicy().getTTLForCreatedEntry(null));
  assertEquals(duration,config.getExpiryPolicy().getTTLForAccessedEntry(null,duration));
  assertEquals(duration,config.getExpiryPolicy().getTTLForModifiedEntry(null,duration));
}

Fixed version (ground truth):
@Test public void checkDefaults(){
  Configuration<?,?> config=getConfiguration();
  assertFalse(config.isReadThrough());
  assertFalse(config.isWriteThrough());
  assertFalse(config.isStatisticsEnabled());
  assertTrue(config.isStoreByValue());
  ExpiryPolicy<?,?> expiryPolicy=config.getExpiryPolicyFactory().create();
  Duration duration=new Duration(TimeUnit.MINUTES,10);
  assertEquals(Duration.ETERNAL,expiryPolicy.getTTLForCreatedEntry(null));
  assertEquals(duration,expiryPolicy.getTTLForAccessedEntry(null,duration));
  assertEquals(duration,expiryPolicy.getTTLForModifiedEntry(null,duration));
}
Program: 19409
Project: 19409
Buggy source:
/** 
 */
@CacheResult(cacheName="String_Node_Str") public Blog getEntryCached(String randomArg,@CacheKeyParam String title,String randomArg2){
  return map.get(title);
}

Fixed version (ground truth):
/** 
 */
@CacheResult(cacheName="String_Node_Str") public Blog getEntryCached(String randomArg,@CacheKey String title,String randomArg2){
  return map.get(title);
}
Program: 19410
Project: 19410
Buggy source:
/** 
 */
@CacheResult public Blog getEntryCached(String randomArg,@CacheKeyParam String title,String randomArg2){
  return map.get(title);
}

Fixed version (ground truth):
/** 
 */
@CacheResult public Blog getEntryCached(String randomArg,@CacheKey String title,String randomArg2){
  return map.get(title);
}
Program: 19411
Project: 19411
Buggy source:
/** 
 * Have to specify the cache name here, the generated name is: manager.UsingDefaultCacheNameBlogManagerImpl.getEntryCached(java.lang.String,java.lang.String,java.lang.String)
 */
@CacheResult(cacheName="String_Node_Str") public Blog getEntryCached(String randomArg,@CacheKeyParam String title,String randomArg2){
  return map.get(title);
}

Fixed version (ground truth):
/** 
 * Have to specify the cache name here, the generated name is: manager.UsingDefaultCacheNameBlogManagerImpl.getEntryCached(java.lang.String,java.lang.String,java.lang.String)
 */
@CacheResult(cacheName="String_Node_Str") public Blog getEntryCached(String randomArg,@CacheKey String title,String randomArg2){
  return map.get(title);
}
Program: 19412
Project: 19412
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Duration getTTLForAccessedEntry(Entry<? extends K,? extends V> entry,Duration duration){
  return accessedExpiryDuration == null ? duration : accessedExpiryDuration;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Duration getTTLForAccessedEntry(Entry<? extends K,? extends V> entry){
  return accessedExpiryDuration;
}
Program: 19413
Project: 19413
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Duration getTTLForModifiedEntry(MutatedEntry<? extends K,? extends V> entry,Duration duration){
  return modifiedExpiryDuration == null ? duration : modifiedExpiryDuration;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Duration getTTLForModifiedEntry(MutatedEntry<? extends K,? extends V> entry){
  return modifiedExpiryDuration;
}
Program: 19414
Project: 19414
Buggy source:
@Test public void checkDefaults(){
  Configuration<?,?> config=getConfiguration();
  assertFalse(config.isReadThrough());
  assertFalse(config.isWriteThrough());
  assertFalse(config.isStatisticsEnabled());
  assertTrue(config.isStoreByValue());
  ExpiryPolicy<?,?> expiryPolicy=config.getExpiryPolicyFactory().create();
  Duration duration=new Duration(TimeUnit.MINUTES,10);
  assertEquals(Duration.ETERNAL,expiryPolicy.getTTLForCreatedEntry(null));
  assertEquals(duration,expiryPolicy.getTTLForAccessedEntry(null,duration));
  assertEquals(duration,expiryPolicy.getTTLForModifiedEntry(null,duration));
}

Fixed version (ground truth):
@Test public void checkDefaults(){
  Configuration<?,?> config=getConfiguration();
  assertFalse(config.isReadThrough());
  assertFalse(config.isWriteThrough());
  assertFalse(config.isStatisticsEnabled());
  assertTrue(config.isStoreByValue());
  ExpiryPolicy<?,?> expiryPolicy=config.getExpiryPolicyFactory().create();
  Duration duration=new Duration(TimeUnit.MINUTES,10);
  assertEquals(Duration.ETERNAL,expiryPolicy.getTTLForCreatedEntry(null));
  assertNull(expiryPolicy.getTTLForAccessedEntry(null));
  assertNull(expiryPolicy.getTTLForModifiedEntry(null));
}
Program: 19415
Project: 19415
Buggy source:
@Override public Cache.Entry<ArrayList<Integer>,String> load(final ArrayList<Integer> key){
  return new Cache.Entry<ArrayList<Integer>,String>(){
    @Override public ArrayList<Integer> getKey(){
      return new ArrayList<Integer>(key);
    }
    @Override public String getValue(){
      return key.toString();
    }
  }
;
}

Fixed version (ground truth):
@Override public Cache.Entry<ArrayList<Integer>,String> load(final ArrayList<Integer> key){
  return new Cache.Entry<ArrayList<Integer>,String>(){
    @Override public ArrayList<Integer> getKey(){
      return new ArrayList<Integer>(key);
    }
    @Override public String getValue(){
      return key.toString();
    }
    @Override public <T>T unwrap(    Class<T> clazz){
      throw new IllegalArgumentException();
    }
  }
;
}
Program: 19416
Project: 19416
Buggy source:
@Test public void removeException(){
  final Integer key=123;
  final String oldValue="String_Node_Str";
  Cache.EntryProcessor<Integer,String,Void> processor=new MockEntryProcessor<Integer,String,Void>(){
    @Override public Void process(    Cache.MutableEntry<Integer,String> entry,    Object... arguments){
      assertTrue(entry.exists());
      entry.remove();
      assertFalse(entry.exists());
      throw new IllegalAccessError();
    }
  }
;
  cache.put(key,oldValue);
  try {
    cache.invokeEntryProcessor(key,processor);
    fail();
  }
 catch (  IllegalAccessError e) {
  }
  assertEquals(oldValue,cache.get(key));
}

Fixed version (ground truth):
@Test public void removeException(){
  final Integer key=123;
  final String oldValue="String_Node_Str";
  Cache.EntryProcessor<Integer,String,Void> processor=new MockEntryProcessor<Integer,String,Void>(){
    @Override public Void process(    Cache.MutableEntry<Integer,String> entry,    Object... arguments){
      assertTrue(entry.exists());
      entry.remove();
      assertFalse(entry.exists());
      throw new IllegalAccessError();
    }
  }
;
  cache.put(key,oldValue);
  try {
    cache.invokeEntryProcessor(key,processor);
    fail();
  }
 catch (  CacheException e) {
    assertTrue(e.getCause() instanceof IllegalAccessError);
  }
  assertEquals(oldValue,cache.get(key));
}
Program: 19417
Project: 19417
Buggy source:
@Test public void noValueException(){
  final Integer key=123;
  final String setValue="String_Node_Str";
  Cache.EntryProcessor<Integer,String,Void> processor=new MockEntryProcessor<Integer,String,Void>(){
    @Override public Void process(    Cache.MutableEntry<Integer,String> entry,    Object... arguments){
      assertFalse(entry.exists());
      entry.setValue(setValue);
      assertTrue(entry.exists());
      throw new IllegalAccessError();
    }
  }
;
  try {
    cache.invokeEntryProcessor(key,processor);
    fail();
  }
 catch (  IllegalAccessError e) {
  }
  assertFalse(cache.containsKey(key));
}

Fixed version (ground truth):
@Test public void noValueException(){
  final Integer key=123;
  final String setValue="String_Node_Str";
  Cache.EntryProcessor<Integer,String,Void> processor=new MockEntryProcessor<Integer,String,Void>(){
    @Override public Void process(    Cache.MutableEntry<Integer,String> entry,    Object... arguments){
      assertFalse(entry.exists());
      entry.setValue(setValue);
      assertTrue(entry.exists());
      throw new IllegalAccessError();
    }
  }
;
  try {
    cache.invokeEntryProcessor(key,processor);
    fail();
  }
 catch (  CacheException e) {
    assertTrue(e.getCause() instanceof IllegalAccessError);
  }
  assertFalse(cache.containsKey(key));
}
Program: 19418
Project: 19418
Buggy source:
@Test public void existingException(){
  final Integer key=123;
  final String oldValue="String_Node_Str";
  final String newValue="String_Node_Str";
  Cache.EntryProcessor<Integer,String,String> processor=new MockEntryProcessor<Integer,String,String>(){
    @Override public String process(    Cache.MutableEntry<Integer,String> entry,    Object... arguments){
      assertTrue(entry.exists());
      assertEquals(oldValue,entry.getValue());
      entry.setValue(newValue);
      assertTrue(entry.exists());
      assertEquals(newValue,entry.getValue());
      throw new IllegalAccessError();
    }
  }
;
  cache.put(key,oldValue);
  try {
    cache.invokeEntryProcessor(key,processor);
    fail();
  }
 catch (  IllegalAccessError e) {
  }
  assertEquals(oldValue,cache.get(key));
}

Fixed version (ground truth):
@Test public void existingException(){
  final Integer key=123;
  final String oldValue="String_Node_Str";
  final String newValue="String_Node_Str";
  Cache.EntryProcessor<Integer,String,String> processor=new MockEntryProcessor<Integer,String,String>(){
    @Override public String process(    Cache.MutableEntry<Integer,String> entry,    Object... arguments){
      assertTrue(entry.exists());
      assertEquals(oldValue,entry.getValue());
      entry.setValue(newValue);
      assertTrue(entry.exists());
      assertEquals(newValue,entry.getValue());
      throw new IllegalAccessError();
    }
  }
;
  cache.put(key,oldValue);
  try {
    cache.invokeEntryProcessor(key,processor);
    fail();
  }
 catch (  CacheException e) {
    assertTrue(e.getCause() instanceof IllegalAccessError);
  }
  assertEquals(oldValue,cache.get(key));
}
Program: 19419
Project: 19419
Buggy source:
@Test public void loadAll_NullKeys(){
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>());
  try {
    cache.loadAll(null,null);
    fail("String_Node_Str");
  }
 catch (  NullPointerException e) {
  }
}

Fixed version (ground truth):
@Test public void loadAll_NullKeys(){
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>());
  try {
    cache.loadAll(null,true,null);
    fail("String_Node_Str");
  }
 catch (  NullPointerException e) {
  }
}
Program: 19420
Project: 19420
Buggy source:
@Test public void load_ExceptionPropagation() throws Exception {
  CacheLoader<Integer,Integer> clDefault=new MockCacheLoader<Integer,Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(clDefault)));
  Integer key=1;
  CompletionListenerFuture future=new CompletionListenerFuture();
  cache.loadAll(Collections.singleton(key),future);
  try {
    future.get(FUTURE_WAIT_MILLIS,TimeUnit.MILLISECONDS);
    assertTrue(future.isDone());
    fail("String_Node_Str");
  }
 catch (  ExecutionException e) {
    assertEquals(UnsupportedOperationException.class,e.getCause().getClass());
  }
}

Fixed version (ground truth):
@Test public void load_ExceptionPropagation() throws Exception {
  CacheLoader<Integer,Integer> clDefault=new MockCacheLoader<Integer,Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(clDefault)));
  Integer key=1;
  CompletionListenerFuture future=new CompletionListenerFuture();
  cache.loadAll(Collections.singleton(key),true,future);
  try {
    future.get(FUTURE_WAIT_MILLIS,TimeUnit.MILLISECONDS);
    assertTrue(future.isDone());
    fail("String_Node_Str");
  }
 catch (  ExecutionException e) {
    assertEquals(UnsupportedOperationException.class,e.getCause().getClass());
  }
}
Program: 19421
Project: 19421
Buggy source:
@Test public void loadAll_DefaultCacheLoader() throws Exception {
  HashSet<Integer> keys=new HashSet<Integer>();
  keys.add(1);
  keys.add(2);
  CacheLoader<Integer,Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(loader)));
  CompletionListenerFuture future=new CompletionListenerFuture();
  cache.loadAll(keys,future);
  future.get(FUTURE_WAIT_MILLIS,TimeUnit.MILLISECONDS);
  assertTrue(future.isDone());
  for (  Integer key : keys) {
    assertEquals(key,cache.get(key));
  }
}

Fixed version (ground truth):
@Test public void loadAll_DefaultCacheLoader() throws Exception {
  HashSet<Integer> keys=new HashSet<Integer>();
  keys.add(1);
  keys.add(2);
  CacheLoader<Integer,Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(loader)));
  CompletionListenerFuture future=new CompletionListenerFuture();
  cache.loadAll(keys,true,future);
  future.get(FUTURE_WAIT_MILLIS,TimeUnit.MILLISECONDS);
  assertTrue(future.isDone());
  for (  Integer key : keys) {
    assertEquals(key,cache.get(key));
  }
}
Program: 19422
Project: 19422
Buggy source:
@Test public void loadAll_1Found1Not() throws Exception {
  SimpleCacheLoader<Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(loader)));
  Integer keyThere=1;
  cache.put(keyThere,keyThere);
  Integer keyNotThere=keyThere + 1;
  HashSet<Integer> keys=new HashSet<Integer>();
  keys.add(keyThere);
  keys.add(keyNotThere);
  CompletionListenerFuture future=new CompletionListenerFuture();
  cache.loadAll(keys,future);
  future.get(FUTURE_WAIT_MILLIS,TimeUnit.MILLISECONDS);
  assertTrue(future.isDone());
  assertEquals(1,loader.getLoadCount());
  assertTrue(loader.hasLoaded(keyNotThere));
  assertEquals(keyThere,cache.get(keyThere));
  assertEquals(keyNotThere,cache.get(keyNotThere));
}

Fixed version (ground truth):
@Test public void loadAll_1Found1Not() throws Exception {
  SimpleCacheLoader<Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(loader)));
  Integer keyThere=1;
  cache.put(keyThere,keyThere);
  Integer keyNotThere=keyThere + 1;
  HashSet<Integer> keys=new HashSet<Integer>();
  keys.add(keyThere);
  keys.add(keyNotThere);
  CompletionListenerFuture future=new CompletionListenerFuture();
  cache.loadAll(keys,true,future);
  future.get(FUTURE_WAIT_MILLIS,TimeUnit.MILLISECONDS);
  assertTrue(future.isDone());
  assertEquals(1,loader.getLoadCount());
  assertTrue(loader.hasLoaded(keyNotThere));
  assertEquals(keyThere,cache.get(keyThere));
  assertEquals(keyNotThere,cache.get(keyNotThere));
}
Program: 19423
Project: 19423
Buggy source:
@Test public void loadAll_NoCacheLoader() throws Exception {
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>());
  HashSet<Integer> keys=new HashSet<Integer>();
  keys.add(1);
  CompletionListenerFuture future=new CompletionListenerFuture();
  try {
    cache.loadAll(keys,future);
  }
 catch (  NullPointerException e) {
    assertTrue(future.isDone());
    fail("String_Node_Str");
  }
}

Fixed version (ground truth):
@Test public void loadAll_NoCacheLoader() throws Exception {
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>());
  HashSet<Integer> keys=new HashSet<Integer>();
  keys.add(1);
  CompletionListenerFuture future=new CompletionListenerFuture();
  try {
    cache.loadAll(keys,true,future);
  }
 catch (  NullPointerException e) {
    assertTrue(future.isDone());
    fail("String_Node_Str");
  }
}
Program: 19424
Project: 19424
Buggy source:
@Test public void loadAll_NullValue() throws Exception {
  CacheLoader<Integer,Integer> loader=new MockCacheLoader<Integer,Integer>(){
    @Override public Map<Integer,Integer> loadAll(    Iterable<? extends Integer> keys){
      Map<Integer,Integer> map=new HashMap<Integer,Integer>();
      for (      Integer key : keys) {
        map.put(key,null);
      }
      return map;
    }
  }
;
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(loader)));
  HashSet<Integer> keys=new HashSet<Integer>();
  keys.add(1);
  keys.add(2);
  CompletionListenerFuture future=new CompletionListenerFuture();
  cache.loadAll(keys,future);
  try {
    future.get(FUTURE_WAIT_MILLIS,TimeUnit.MILLISECONDS);
    assertTrue(future.isDone());
    fail("String_Node_Str");
  }
 catch (  ExecutionException e) {
    assertTrue(e.getCause() instanceof NullPointerException);
  }
}

Fixed version (ground truth):
@Test public void loadAll_NullValue() throws Exception {
  CacheLoader<Integer,Integer> loader=new MockCacheLoader<Integer,Integer>(){
    @Override public Map<Integer,Integer> loadAll(    Iterable<? extends Integer> keys){
      Map<Integer,Integer> map=new HashMap<Integer,Integer>();
      for (      Integer key : keys) {
        map.put(key,null);
      }
      return map;
    }
  }
;
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(loader)));
  HashSet<Integer> keys=new HashSet<Integer>();
  keys.add(1);
  keys.add(2);
  CompletionListenerFuture future=new CompletionListenerFuture();
  cache.loadAll(keys,true,future);
  try {
    future.get(FUTURE_WAIT_MILLIS,TimeUnit.MILLISECONDS);
    assertTrue(future.isDone());
    fail("String_Node_Str");
  }
 catch (  ExecutionException e) {
    assertTrue(e.getCause() instanceof NullPointerException);
  }
}
Program: 19425
Project: 19425
Buggy source:
@Test public void load_DefaultCacheLoader() throws Exception {
  CacheLoader<Integer,Integer> clDefault=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(clDefault)));
  Integer key=123;
  CompletionListenerFuture future=new CompletionListenerFuture();
  cache.loadAll(Collections.singleton(key),future);
  future.get(FUTURE_WAIT_MILLIS,TimeUnit.MILLISECONDS);
  assertTrue(future.isDone());
  assertTrue(cache.containsKey(key));
  assertEquals(key,cache.get(key));
}

Fixed version (ground truth):
@Test public void load_DefaultCacheLoader() throws Exception {
  CacheLoader<Integer,Integer> clDefault=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(clDefault)));
  Integer key=123;
  CompletionListenerFuture future=new CompletionListenerFuture();
  cache.loadAll(Collections.singleton(key),true,future);
  future.get(FUTURE_WAIT_MILLIS,TimeUnit.MILLISECONDS);
  assertTrue(future.isDone());
  assertTrue(cache.containsKey(key));
  assertEquals(key,cache.get(key));
}
Program: 19426
Project: 19426
Buggy source:
@Test public void loadAll_NullKey() throws Exception {
  CacheLoader<Integer,Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(loader)));
  HashSet<Integer> keys=new HashSet<Integer>();
  keys.add(null);
  try {
    CompletionListenerFuture future=new CompletionListenerFuture();
    cache.loadAll(keys,future);
    future.get(FUTURE_WAIT_MILLIS,TimeUnit.MILLISECONDS);
    assertTrue(future.isDone());
    fail("String_Node_Str");
  }
 catch (  ExecutionException e) {
    assertTrue(e.getCause() instanceof NullPointerException);
  }
}

Fixed version (ground truth):
@Test public void loadAll_NullKey() throws Exception {
  CacheLoader<Integer,Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(loader)));
  HashSet<Integer> keys=new HashSet<Integer>();
  keys.add(null);
  try {
    CompletionListenerFuture future=new CompletionListenerFuture();
    cache.loadAll(keys,true,future);
    future.get(FUTURE_WAIT_MILLIS,TimeUnit.MILLISECONDS);
    assertTrue(future.isDone());
    fail("String_Node_Str");
  }
 catch (  ExecutionException e) {
    assertTrue(e.getCause() instanceof NullPointerException);
  }
}
Program: 19427
Project: 19427
Buggy source:
@Test public void loadAll_ExceptionPropagation() throws Exception {
  final RuntimeException expectedException=new RuntimeException("String_Node_Str");
  CacheLoader<Integer,Integer> loader=new MockCacheLoader<Integer,Integer>(){
    @Override public Map<Integer,Integer> loadAll(    Iterable<? extends Integer> keys){
      throw expectedException;
    }
  }
;
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(loader)));
  HashSet<Integer> keys=new HashSet<Integer>();
  keys.add(1);
  CompletionListenerFuture future=new CompletionListenerFuture();
  cache.loadAll(keys,future);
  try {
    future.get(FUTURE_WAIT_MILLIS,TimeUnit.MILLISECONDS);
    fail("String_Node_Str");
  }
 catch (  ExecutionException e) {
    assertTrue(future.isDone());
    assertEquals(expectedException,e.getCause());
  }
}

Fixed version (ground truth):
@Test public void loadAll_ExceptionPropagation() throws Exception {
  final RuntimeException expectedException=new RuntimeException("String_Node_Str");
  CacheLoader<Integer,Integer> loader=new MockCacheLoader<Integer,Integer>(){
    @Override public Map<Integer,Integer> loadAll(    Iterable<? extends Integer> keys){
      throw expectedException;
    }
  }
;
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(loader)));
  HashSet<Integer> keys=new HashSet<Integer>();
  keys.add(1);
  CompletionListenerFuture future=new CompletionListenerFuture();
  cache.loadAll(keys,true,future);
  try {
    future.get(FUTURE_WAIT_MILLIS,TimeUnit.MILLISECONDS);
    fail("String_Node_Str");
  }
 catch (  ExecutionException e) {
    assertTrue(future.isDone());
    assertEquals(expectedException,e.getCause());
  }
}
Program: 19428
Project: 19428
Buggy source:
@Test public void loadAll_NotStarted(){
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>());
  cache.stop();
  try {
    cache.loadAll(null,null);
    fail("String_Node_Str");
  }
 catch (  IllegalStateException e) {
  }
}

Fixed version (ground truth):
@Test public void loadAll_NotStarted(){
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>());
  cache.stop();
  try {
    cache.loadAll(null,true,null);
    fail("String_Node_Str");
  }
 catch (  IllegalStateException e) {
  }
}
Program: 19429
Project: 19429
Buggy source:
@Test public void load_NotStarted(){
  cache.stop();
  try {
    cache.loadAll(null,null);
    fail("String_Node_Str");
  }
 catch (  IllegalStateException e) {
  }
}

Fixed version (ground truth):
@Test public void load_NotStarted(){
  cache.stop();
  try {
    cache.loadAll(null,true,null);
    fail("String_Node_Str");
  }
 catch (  IllegalStateException e) {
  }
}
Program: 19430
Project: 19430
Buggy source:
protected <A,B>MutableConfiguration<A,B> extraSetup(MutableConfiguration<A,B> configuration){
  return configuration.setExpiryPolicyFactory(Factories.of(new ExpiryPolicy.Modified<A,B>(new Configuration.Duration(TimeUnit.MILLISECONDS,20))));
}

Fixed version (ground truth):
@Override protected MutableConfiguration<Long,String> extraSetup(MutableConfiguration<Long,String> configuration){
  return configuration.setExpiryPolicyFactory(Factories.of(new ExpiryPolicy.Modified<Long,String>(new Configuration.Duration(TimeUnit.MILLISECONDS,20))));
}
Program: 19431
Project: 19431
Buggy source:
protected <A,B>MutableConfiguration<A,B> extraSetup(MutableConfiguration<A,B> configuration){
  return configuration.setStoreByValue(true);
}

Fixed version (ground truth):
@Override protected MutableConfiguration<Long,String> extraSetup(MutableConfiguration<Long,String> configuration){
  return configuration.setStoreByValue(true);
}
Program: 19432
Project: 19432
Buggy source:
@Test() public void clearTest(){
  String cacheName="String_Node_Str";
  CacheManager cacheManager=getCacheManager();
  Cache<String,Integer> cache=cacheManager.getCache(cacheName);
  cache=cacheManager.configureCache(cacheName,new MutableConfiguration<String,Integer>().setStoreByValue(true));
  ;
  String key="String_Node_Str";
  Integer value1=1;
  cache.put(key,value1);
  Integer value2=cache.get(key);
  assertEquals(value1,value2);
  cache.clear();
  assertNull(cache.get(key));
}

Fixed version (ground truth):
@Test() public void clearTest(){
  Long key=1L;
  String value1="String_Node_Str";
  cache.put(key,value1);
  String value2=cache.get(key);
  assertEquals(value1,value2);
  cache.clear();
  assertNull(cache.get(key));
}
Program: 19433
Project: 19433
Buggy source:
@Test public void simpleAPI(){
  String cacheName="String_Node_Str";
  CacheManager cacheManager=getCacheManager();
  Cache<String,Integer> cache=cacheManager.getCache(cacheName);
  cache=cacheManager.configureCache(cacheName,new MutableConfiguration<String,Integer>().setStoreByValue(true));
  ;
  String key="String_Node_Str";
  Integer value1=1;
  cache.put(key,value1);
  Integer value2=cache.get(key);
  assertEquals(value1,value2);
}

Fixed version (ground truth):
@Test public void simpleAPI(){
  Long key=1L;
  String value1="String_Node_Str";
  cache.put(key,value1);
  String value2=cache.get(key);
  assertEquals(value1,value2);
}
Program: 19434
Project: 19434
Buggy source:
@Before public void setUp(){
  cache=getCacheManager().configureCache(getTestCacheName(),extraSetup(new MutableConfiguration<K,V>()));
}

Fixed version (ground truth):
@Before public void setUp(){
  cache=getCacheManager().configureCache(getTestCacheName(),extraSetup(newMutableConfiguration()));
}
Program: 19435
Project: 19435
Buggy source:
protected <A,B>MutableConfiguration<A,B> extraSetup(MutableConfiguration<A,B> configuration){
  return configuration;
}

Fixed version (ground truth):
protected MutableConfiguration<K,V> extraSetup(MutableConfiguration<K,V> configuration){
  return configuration;
}
Program: 19436
Project: 19436
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override protected <A,B>MutableConfiguration<A,B> extraSetup(MutableConfiguration<A,B> configuration){
  return super.extraSetup(configuration).setStoreByValue(false);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected MutableConfiguration<Date,Date> extraSetup(MutableConfiguration<Date,Date> configuration){
  return super.extraSetup(configuration).setStoreByValue(false);
}
Program: 19437
Project: 19437
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Duration getTTLForModifiedEntry(Entry<? extends K,? extends V> entry,Duration duration){
  return modifiedExpiryDuration == null ? duration : modifiedExpiryDuration;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Duration getTTLForModifiedEntry(MutatedEntry<? extends K,? extends V> entry,Duration duration){
  return modifiedExpiryDuration == null ? duration : modifiedExpiryDuration;
}
Program: 19438
Project: 19438
Buggy source:
@Override protected MutableConfiguration<Integer,String> newMutableConfiguration(){
  return new MutableConfiguration<Integer,String>(Integer.class,String.class);
}

Fixed version (ground truth):
@Override protected MutableConfiguration<Integer,String> newMutableConfiguration(){
  return new MutableConfiguration<Integer,String>().setTypes(Integer.class,String.class);
}
Program: 19439
Project: 19439
Buggy source:
@Override protected MutableConfiguration<Long,String> newMutableConfiguration(){
  return new MutableConfiguration<Long,String>(Long.class,String.class);
}

Fixed version (ground truth):
@Override protected MutableConfiguration<Long,String> newMutableConfiguration(){
  return new MutableConfiguration<Long,String>().setTypes(Long.class,String.class);
}
Program: 19440
Project: 19440
Buggy source:
@Test(expected=ClassCastException.class) public void getUnsafeTypedCacheRequest(){
  CacheManager cacheManager=getCacheManager();
  MutableConfiguration<String,Long> config=new MutableConfiguration<String,Long>(String.class,Long.class);
  cacheManager.configureCache("String_Node_Str",config);
  Cache cache=cacheManager.getCache("String_Node_Str");
}

Fixed version (ground truth):
@Test(expected=ClassCastException.class) public void getUnsafeTypedCacheRequest(){
  CacheManager cacheManager=getCacheManager();
  MutableConfiguration<String,Long> config=new MutableConfiguration<String,Long>().setTypes(String.class,Long.class);
  cacheManager.configureCache("String_Node_Str",config);
  Cache cache=cacheManager.getCache("String_Node_Str");
}