nus-yam/ex-repair huggingface dataset:
Program: 19344
Project: 19344
Buggy source:
@Test public void existingReplace(){
  final Integer key=123;
  final String oldValue="String_Node_Str";
  final String newValue="String_Node_Str";
  Cache.EntryProcessor<Integer,String,String> processor=new ExistingReplaceEntryProcessor<Integer,String,String>(oldValue,newValue);
  cache.put(key,oldValue);
  assertEquals(oldValue,cache.invokeEntryProcessor(key,processor));
  assertEquals(newValue,cache.get(key));
}

Fixed version (ground truth):
@Test public void existingReplace(){
  final Integer key=123;
  final String oldValue="String_Node_Str";
  final String newValue="String_Node_Str";
  Cache.EntryProcessor<Integer,String,String> processor=new ExistingReplaceEntryProcessor<Integer,String,String>(oldValue,newValue);
  cache.put(key,oldValue);
  assertEquals(oldValue,cache.invoke(key,processor));
  assertEquals(newValue,cache.get(key));
}
Program: 19345
Project: 19345
Buggy source:
@Test public void removeMissing(){
  final Integer key=123;
  final Integer ret=456;
  Cache.EntryProcessor<Integer,String,Integer> processor=new RemoveMissingEntryProcessor<Integer,String,Integer>(ret);
  assertEquals(ret,cache.invokeEntryProcessor(key,processor));
  assertFalse(cache.containsKey(key));
}

Fixed version (ground truth):
@Test public void removeMissing(){
  final Integer key=123;
  final Integer ret=456;
  Cache.EntryProcessor<Integer,String,Integer> processor=new RemoveMissingEntryProcessor<Integer,String,Integer>(ret);
  assertEquals(ret,cache.invoke(key,processor));
  assertFalse(cache.containsKey(key));
}
Program: 19346
Project: 19346
Buggy source:
@Test public void removeException(){
  final Integer key=123;
  final String oldValue="String_Node_Str";
  Cache.EntryProcessor<Integer,String,Void> processor=new RemoveExceptionEntryProcessor<Integer,String,Void>();
  cache.put(key,oldValue);
  try {
    cache.invokeEntryProcessor(key,processor);
    fail();
  }
 catch (  CacheException e) {
    assertTrue(e.getCause() instanceof IllegalAccessError);
  }
  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 RemoveExceptionEntryProcessor<Integer,String,Void>();
  cache.put(key,oldValue);
  try {
    cache.invoke(key,processor);
    fail();
  }
 catch (  CacheException e) {
    assertTrue(e.getCause() instanceof IllegalAccessError);
  }
  assertEquals(oldValue,cache.get(key));
}
Program: 19347
Project: 19347
Buggy source:
@Test public void nullProcessor(){
  try {
    cache.invokeEntryProcessor(123,null);
    fail("String_Node_Str");
  }
 catch (  NullPointerException e) {
  }
}

Fixed version (ground truth):
@Test public void nullProcessor(){
  try {
    cache.invoke(123,null);
    fail("String_Node_Str");
  }
 catch (  NullPointerException e) {
  }
}
Program: 19348
Project: 19348
Buggy source:
@Test public void noValueException(){
  final Integer key=123;
  final String setValue="String_Node_Str";
  Cache.EntryProcessor<Integer,String,Void> processor=new NoValueExceptionEntryProcessor<Integer,String,Void>(setValue);
  try {
    cache.invokeEntryProcessor(key,processor);
    fail();
  }
 catch (  CacheException e) {
    assertTrue(e.getCause() instanceof IllegalAccessError);
  }
  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 NoValueExceptionEntryProcessor<Integer,String,Void>(setValue);
  try {
    cache.invoke(key,processor);
    fail();
  }
 catch (  CacheException e) {
    assertTrue(e.getCause() instanceof IllegalAccessError);
  }
  assertFalse(cache.containsKey(key));
}
Program: 19349
Project: 19349
Buggy source:
@Test public void noValueNoMutation(){
  final Integer key=123;
  final Integer ret=456;
  Cache.EntryProcessor<Integer,String,Integer> processor=new NoValueNoMutationEntryProcessor<Integer,String,Integer>(ret);
  assertEquals(ret,cache.invokeEntryProcessor(key,processor));
  assertFalse(cache.containsKey(key));
}

Fixed version (ground truth):
@Test public void noValueNoMutation(){
  final Integer key=123;
  final Integer ret=456;
  Cache.EntryProcessor<Integer,String,Integer> processor=new NoValueNoMutationEntryProcessor<Integer,String,Integer>(ret);
  assertEquals(ret,cache.invoke(key,processor));
  assertFalse(cache.containsKey(key));
}
Program: 19350
Project: 19350
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 ExistingExceptionEntryProcessor<Integer,String,String>(oldValue,newValue);
  cache.put(key,oldValue);
  try {
    cache.invokeEntryProcessor(key,processor);
    fail();
  }
 catch (  CacheException e) {
    assertTrue(e.getCause() instanceof IllegalAccessError);
  }
  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 ExistingExceptionEntryProcessor<Integer,String,String>(oldValue,newValue);
  cache.put(key,oldValue);
  try {
    cache.invoke(key,processor);
    fail();
  }
 catch (  CacheException e) {
    assertTrue(e.getCause() instanceof IllegalAccessError);
  }
  assertEquals(oldValue,cache.get(key));
}
Program: 19351
Project: 19351
Buggy source:
@Test public void varArgumentsPassedIn(){
  final Integer key=123;
  final Integer ret=456;
  Cache.EntryProcessor<Integer,String,Integer> processor=new VarArgumentsPassedInEntryProcessor<Integer,String,Integer>(ret);
  assertEquals(ret,cache.invokeEntryProcessor(key,processor,"String_Node_Str","String_Node_Str","String_Node_Str",1L));
  assertFalse(cache.containsKey(key));
}

Fixed version (ground truth):
@Test public void varArgumentsPassedIn(){
  final Integer key=123;
  final Integer ret=456;
  Cache.EntryProcessor<Integer,String,Integer> processor=new VarArgumentsPassedInEntryProcessor<Integer,String,Integer>(ret);
  assertEquals(ret,cache.invoke(key,processor,"String_Node_Str","String_Node_Str","String_Node_Str",1L));
  assertFalse(cache.containsKey(key));
}
Program: 19352
Project: 19352
Buggy source:
@Test public void noValueSetValue(){
  final Integer key=123;
  final Integer ret=456;
  final String newValue="String_Node_Str";
  Cache.EntryProcessor<Integer,String,Integer> processor=new NoValueSetValueEntryProcessor<Integer,String,Integer>(ret,newValue);
  assertEquals(ret,cache.invokeEntryProcessor(key,processor));
  assertEquals(newValue,cache.get(key));
}

Fixed version (ground truth):
@Test public void noValueSetValue(){
  final Integer key=123;
  final Integer ret=456;
  final String newValue="String_Node_Str";
  Cache.EntryProcessor<Integer,String,Integer> processor=new NoValueSetValueEntryProcessor<Integer,String,Integer>(ret,newValue);
  assertEquals(ret,cache.invoke(key,processor));
  assertEquals(newValue,cache.get(key));
}
Program: 19353
Project: 19353
Buggy source:
@Test public void close(){
  cache.close();
  try {
    cache.invokeEntryProcessor(123,new MockEntryProcessor<Integer,String,Void>());
    fail("String_Node_Str");
  }
 catch (  IllegalStateException e) {
  }
}

Fixed version (ground truth):
@Test public void close(){
  cache.close();
  try {
    cache.invoke(123,new MockEntryProcessor<Integer,String,Void>());
    fail("String_Node_Str");
  }
 catch (  IllegalStateException e) {
  }
}
Program: 19355
Project: 19355
Buggy source:
@Test public void invoke_UpdateEntry(){
  assertEquals(0,cacheWriter.getWriteCount());
  assertEquals(0,cacheWriter.getDeleteCount());
  cache.put(1,"String_Node_Str");
  cache.invokeEntryProcessor(1,new Cache.EntryProcessor<Integer,String,Void>(){
    @Override public Void process(    Cache.MutableEntry<Integer,String> entry,    Object... arguments){
      entry.setValue("String_Node_Str");
      return null;
    }
  }
);
  assertEquals(2,cacheWriter.getWriteCount());
  assertEquals(0,cacheWriter.getDeleteCount());
  assertTrue(cacheWriter.containsKey(1));
  assertEquals("String_Node_Str",cacheWriter.get(1));
}

Fixed version (ground truth):
@Test public void invoke_UpdateEntry(){
  assertEquals(0,cacheWriter.getWriteCount());
  assertEquals(0,cacheWriter.getDeleteCount());
  cache.put(1,"String_Node_Str");
  cache.invoke(1,new Cache.EntryProcessor<Integer,String,Void>(){
    @Override public Void process(    Cache.MutableEntry<Integer,String> entry,    Object... arguments){
      entry.setValue("String_Node_Str");
      return null;
    }
  }
);
  assertEquals(2,cacheWriter.getWriteCount());
  assertEquals(0,cacheWriter.getDeleteCount());
  assertTrue(cacheWriter.containsKey(1));
  assertEquals("String_Node_Str",cacheWriter.get(1));
}
Program: 19356
Project: 19356
Buggy source:
@Test public void invoke_RemoveEntry(){
  assertEquals(0,cacheWriter.getWriteCount());
  assertEquals(0,cacheWriter.getDeleteCount());
  cache.put(1,"String_Node_Str");
  cache.invokeEntryProcessor(1,new Cache.EntryProcessor<Integer,String,Void>(){
    @Override public Void process(    Cache.MutableEntry<Integer,String> entry,    Object... arguments){
      entry.remove();
      return null;
    }
  }
);
  assertEquals(1,cacheWriter.getWriteCount());
  assertEquals(1,cacheWriter.getDeleteCount());
  assertFalse(cacheWriter.containsKey(1));
}

Fixed version (ground truth):
@Test public void invoke_RemoveEntry(){
  assertEquals(0,cacheWriter.getWriteCount());
  assertEquals(0,cacheWriter.getDeleteCount());
  cache.put(1,"String_Node_Str");
  cache.invoke(1,new Cache.EntryProcessor<Integer,String,Void>(){
    @Override public Void process(    Cache.MutableEntry<Integer,String> entry,    Object... arguments){
      entry.remove();
      return null;
    }
  }
);
  assertEquals(1,cacheWriter.getWriteCount());
  assertEquals(1,cacheWriter.getDeleteCount());
  assertFalse(cacheWriter.containsKey(1));
}
Program: 19357
Project: 19357
Buggy source:
@Test public void invoke_CreateEntry(){
  assertEquals(0,cacheWriter.getWriteCount());
  assertEquals(0,cacheWriter.getDeleteCount());
  cache.invokeEntryProcessor(1,new Cache.EntryProcessor<Integer,String,Void>(){
    @Override public Void process(    Cache.MutableEntry<Integer,String> entry,    Object... arguments){
      entry.setValue("String_Node_Str");
      return null;
    }
  }
);
  assertEquals(1,cacheWriter.getWriteCount());
  assertEquals(0,cacheWriter.getDeleteCount());
  assertTrue(cacheWriter.containsKey(1));
  assertEquals("String_Node_Str",cacheWriter.get(1));
}

Fixed version (ground truth):
@Test public void invoke_CreateEntry(){
  assertEquals(0,cacheWriter.getWriteCount());
  assertEquals(0,cacheWriter.getDeleteCount());
  cache.invoke(1,new Cache.EntryProcessor<Integer,String,Void>(){
    @Override public Void process(    Cache.MutableEntry<Integer,String> entry,    Object... arguments){
      entry.setValue("String_Node_Str");
      return null;
    }
  }
);
  assertEquals(1,cacheWriter.getWriteCount());
  assertEquals(0,cacheWriter.getDeleteCount());
  assertTrue(cacheWriter.containsKey(1));
  assertEquals("String_Node_Str",cacheWriter.get(1));
}
Program: 19358
Project: 19358
Buggy source:
@Test public void testCacheStatisticsInvokeEntryProcessorRemove() throws Exception {
  cache.put(1l,"String_Node_Str");
  String result=cache.invokeEntryProcessor(1l,new Cache.EntryProcessor<Long,String,String>(){
    @Override public String process(    Cache.MutableEntry<Long,String> entry,    Object... arguments){
      String value=entry.getValue();
      entry.remove();
      return "String_Node_Str";
    }
  }
);
  assertEquals(1L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(1.0f,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(0L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(0f,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(1L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(1L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(0L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertThat((Float)lookupCacheStatisticsAttribute(cache,"String_Node_Str"),greaterThanOrEqualTo(0f));
  assertThat((Float)lookupCacheStatisticsAttribute(cache,"String_Node_Str"),greaterThanOrEqualTo(0f));
  assertThat((Float)lookupCacheStatisticsAttribute(cache,"String_Node_Str"),greaterThanOrEqualTo(0f));
}

Fixed version (ground truth):
@Test public void testCacheStatisticsInvokeEntryProcessorRemove() throws Exception {
  cache.put(1l,"String_Node_Str");
  String result=cache.invoke(1l,new Cache.EntryProcessor<Long,String,String>(){
    @Override public String process(    Cache.MutableEntry<Long,String> entry,    Object... arguments){
      String value=entry.getValue();
      entry.remove();
      return "String_Node_Str";
    }
  }
);
  assertEquals(1L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(1.0f,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(0L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(0f,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(1L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(1L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(0L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertThat((Float)lookupCacheStatisticsAttribute(cache,"String_Node_Str"),greaterThanOrEqualTo(0f));
  assertThat((Float)lookupCacheStatisticsAttribute(cache,"String_Node_Str"),greaterThanOrEqualTo(0f));
  assertThat((Float)lookupCacheStatisticsAttribute(cache,"String_Node_Str"),greaterThanOrEqualTo(0f));
}
Program: 19359
Project: 19359
Buggy source:
@Test public void testCacheStatisticsInvokeEntryProcessorCreate() throws Exception {
  cache.put(1l,"String_Node_Str");
  String result=cache.invokeEntryProcessor(1l,new Cache.EntryProcessor<Long,String,String>(){
    @Override public String process(    Cache.MutableEntry<Long,String> entry,    Object... arguments){
      String value=entry.getValue();
      entry.setValue("String_Node_Str");
      return "String_Node_Str";
    }
  }
);
  assertEquals(1L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(1.0f,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(0L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(0f,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(2L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(0L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(0L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertThat((Float)lookupCacheStatisticsAttribute(cache,"String_Node_Str"),greaterThanOrEqualTo(0f));
  assertThat((Float)lookupCacheStatisticsAttribute(cache,"String_Node_Str"),greaterThanOrEqualTo(0f));
  assertEquals(0f,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testCacheStatisticsInvokeEntryProcessorCreate() throws Exception {
  cache.put(1l,"String_Node_Str");
  String result=cache.invoke(1l,new Cache.EntryProcessor<Long,String,String>(){
    @Override public String process(    Cache.MutableEntry<Long,String> entry,    Object... arguments){
      String value=entry.getValue();
      entry.setValue("String_Node_Str");
      return "String_Node_Str";
    }
  }
);
  assertEquals(1L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(1.0f,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(0L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(0f,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(2L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(0L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(0L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertThat((Float)lookupCacheStatisticsAttribute(cache,"String_Node_Str"),greaterThanOrEqualTo(0f));
  assertThat((Float)lookupCacheStatisticsAttribute(cache,"String_Node_Str"),greaterThanOrEqualTo(0f));
  assertEquals(0f,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
}
Program: 19360
Project: 19360
Buggy source:
@Test public void testCacheStatisticsInvokeEntryProcessorGet() throws Exception {
  cache.put(1l,"String_Node_Str");
  String result=cache.invokeEntryProcessor(1l,new Cache.EntryProcessor<Long,String,String>(){
    @Override public String process(    Cache.MutableEntry<Long,String> entry,    Object... arguments){
      return entry.getValue();
    }
  }
);
  assertEquals(1L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(1.0f,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(0L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(0f,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(1L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(0L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(0L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertThat((Float)lookupCacheStatisticsAttribute(cache,"String_Node_Str"),greaterThanOrEqualTo(0f));
  assertThat((Float)lookupCacheStatisticsAttribute(cache,"String_Node_Str"),greaterThanOrEqualTo(0f));
  assertEquals(0f,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testCacheStatisticsInvokeEntryProcessorGet() throws Exception {
  cache.put(1l,"String_Node_Str");
  String result=cache.invoke(1l,new Cache.EntryProcessor<Long,String,String>(){
    @Override public String process(    Cache.MutableEntry<Long,String> entry,    Object... arguments){
      return entry.getValue();
    }
  }
);
  assertEquals(1L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(1.0f,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(0L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(0f,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(1L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(0L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertEquals(0L,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
  assertThat((Float)lookupCacheStatisticsAttribute(cache,"String_Node_Str"),greaterThanOrEqualTo(0f));
  assertThat((Float)lookupCacheStatisticsAttribute(cache,"String_Node_Str"),greaterThanOrEqualTo(0f));
  assertEquals(0f,lookupCacheStatisticsAttribute(cache,"String_Node_Str"));
}
Program: 19361
Project: 19361
Buggy source:
/** 
 * Ensure that we can't create a   {@link Duration} using a<code>null</code>  {@link TimeUnit}.
 */
@Test(expected=NullPointerException.class) public void shouldNotCreateDurationWithNullTimeUnit(){
  Duration duration=new Duration(null,1);
}

Fixed version (ground truth):
/** 
 * Ensure that we can't create a   {@link Duration} using a<code>null</code>  {@link TimeUnit}.
 */
@Test(expected=NullPointerException.class) public void shouldNotCreateDurationWithNullTimeUnit(){
  new Duration(null,1);
}
Program: 19362
Project: 19362
Buggy source:
@Override protected MutableConfiguration<Long,String> extraSetup(MutableConfiguration<Long,String> configuration){
  listener=new MyCacheEntryListener<Long,String>();
  configuration.registerCacheEntryListener(listener,false,null,true);
  return configuration.setExpiryPolicyFactory(FactoryBuilder.factoryOf(new ModifiedExpiryPolicy<Long,String>(new Duration(TimeUnit.MILLISECONDS,20))));
}

Fixed version (ground truth):
@Override protected MutableConfiguration<Long,String> extraSetup(MutableConfiguration<Long,String> configuration){
  listener=new MyCacheEntryListener<Long,String>();
  configuration.registerCacheEntryListener(FactoryBuilder.factoryOf(listener),false,null,true);
  return configuration.setExpiryPolicyFactory(FactoryBuilder.factoryOf(new ModifiedExpiryPolicy<Long,String>(new Duration(TimeUnit.MILLISECONDS,20))));
}
Program: 19365
Project: 19365
Buggy source:
@Override public void onExpired(Iterable<CacheEntryEvent<? extends K,? extends V>> events) throws CacheEntryListenerException {
  for (  CacheEntryEvent<? extends K,? extends V> event : events) {
    assertEquals(EXPIRED,event.getEventType());
    expired.incrementAndGet();
  }
}

Fixed version (ground truth):
@Override public void onExpired(Iterable<CacheEntryEvent<? extends K,? extends V>> events) throws CacheEntryListenerException {
}
Program: 19366
Project: 19366
Buggy source:
/** 
 * Check the listener doesn't get removes from a cache.clear
 */
@Test public void testCacheClearListener(){
  MyCacheEntryListener<Long,String> listener=new MyCacheEntryListener<Long,String>();
  cache.registerCacheEntryListener(listener,false,null,true);
  assertEquals(0,listener.getCreated());
  assertEquals(0,listener.getUpdated());
  assertEquals(0,listener.getExpired());
  assertEquals(0,listener.getRemoved());
  cache.put(1l,"String_Node_Str");
  assertEquals(1,listener.getCreated());
  assertEquals(0,listener.getUpdated());
  assertEquals(0,listener.getExpired());
  assertEquals(0,listener.getRemoved());
  cache.clear();
  assertEquals(1,listener.getCreated());
  assertEquals(0,listener.getUpdated());
  assertEquals(0,listener.getExpired());
  assertEquals(0,listener.getRemoved());
}

Fixed version (ground truth):
/** 
 * Check the listener doesn't get removes from a cache.clear
 */
@Test public void testCacheClearListener(){
  MyCacheEntryListener<Long,String> listener=new MyCacheEntryListener<Long,String>();
  cache.registerCacheEntryListener(listener,false,null,true);
  assertEquals(0,listener.getCreated());
  assertEquals(0,listener.getUpdated());
  assertEquals(0,listener.getRemoved());
  cache.put(1l,"String_Node_Str");
  assertEquals(1,listener.getCreated());
  assertEquals(0,listener.getUpdated());
  assertEquals(0,listener.getRemoved());
  cache.clear();
  assertEquals(1,listener.getCreated());
  assertEquals(0,listener.getUpdated());
  assertEquals(0,listener.getRemoved());
}
Program: 19367
Project: 19367
Buggy source:
@Test public void nullKey(){
  try {
    cache.invokeEntryProcessor(null,new MockEntryProcessor<Integer,String,Void>());
    fail("String_Node_Str");
  }
 catch (  NullPointerException e) {
  }
}

Fixed version (ground truth):
@Test public void nullKey(){
  try {
    cache.invokeEntryProcessor((Integer)null,new MockEntryProcessor<Integer,String,Void>());
    fail("String_Node_Str");
  }
 catch (  NullPointerException e) {
  }
}
Program: 19368
Project: 19368
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public V onInvoke(ObjectInputStream ois,ObjectOutputStream oos) throws IOException, ClassNotFoundException {
  oos.writeObject(key);
  Object o=ois.readObject();
  if (o instanceof RuntimeException) {
    throw (RuntimeException)o;
  }
 else {
    return (V)o;
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Map<K,V> onInvoke(ObjectInputStream ois,ObjectOutputStream oos) throws IOException, ClassNotFoundException, ExecutionException {
  for (  K key : keys) {
    oos.writeObject(key);
  }
  oos.writeObject(null);
  HashMap<K,V> map=new HashMap<K,V>();
  Object result=ois.readObject();
  while (result != null && !(result instanceof Exception)) {
    K key=(K)result;
    V value=(V)ois.readObject();
    map.put(key,value);
    result=ois.readObject();
  }
  if (result instanceof RuntimeException) {
    throw (RuntimeException)result;
  }
 else {
    return map;
  }
}
Program: 19369
Project: 19369
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Map<K,V> loadAll(Iterable<? extends K> keys){
  HashMap<K,V> map=new HashMap<K,V>();
  for (  K key : keys) {
    Cache.Entry<K,V> entry=load(key);
    if (entry != null && entry.getValue() != null) {
      map.put(key,entry.getValue());
    }
  }
  return map;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Map<K,V> loadAll(Iterable<? extends K> keys){
  return getClient().invoke(new LoadAllOperation<K,V>(keys));
}
Program: 19370
Project: 19370
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Map<K,V> loadAll(Iterable<? extends K> keys){
  Hashtable<K,V> map=new Hashtable<K,V>();
  for (  K key : keys) {
    map.put(key,null);
  }
  return map;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Map<K,V> loadAll(Iterable<? extends K> keys){
  HashMap<K,V> map=new HashMap<K,V>();
  for (  K key : keys) {
    map.put(key,null);
  }
  return map;
}
Program: 19371
Project: 19371
Buggy source:
public SetEntryProcessor(V setValue){
  this.setValue=setValue;
}

Fixed version (ground truth):
public SetEntryProcessor(V value){
  this.value=value;
}
Program: 19372
Project: 19372
Buggy source:
@Override protected MutableConfiguration<Long,String> extraSetup(MutableConfiguration<Long,String> configuration){
  listener=new MyCacheEntryListener<Long,String>();
  CacheEntryListenerFactoryDefinition definition=new MutableConfiguration.MutableCacheEntryListenerFactoryDefinition(FactoryBuilder.factoryOf(listener),null,false,true);
  configuration.addCacheEntryListenerFactoryDefinition(definition);
  return configuration.setExpiryPolicyFactory(FactoryBuilder.factoryOf(new ModifiedExpiryPolicy<Long,String>(new Duration(TimeUnit.MILLISECONDS,20))));
}

Fixed version (ground truth):
@Override protected MutableConfiguration<Long,String> extraSetup(MutableConfiguration<Long,String> configuration){
  listener=new MyCacheEntryListener<Long,String>();
  configuration.addCacheEntryListenerConfiguration(FactoryBuilder.factoryOf(listener),null,false,true);
  return configuration.setExpiryPolicyFactory(FactoryBuilder.factoryOf(new ModifiedExpiryPolicy<Long,String>(new Duration(TimeUnit.MILLISECONDS,20))));
}
Program: 19373
Project: 19373
Buggy source:
@Test public void testReuseCacheManager() throws Exception {
  URI uri=new URI(this.getClass().getName());
  CachingProvider provider=Caching.getCachingProvider();
  CacheManager cacheManager=provider.getCacheManager(uri,provider.getDefaultClassLoader());
  assertFalse(cacheManager.isClosed());
  cacheManager.close();
  assertTrue(cacheManager.isClosed());
  try {
    cacheManager.configureCache("String_Node_Str",null);
    fail();
  }
 catch (  IllegalStateException e) {
  }
  CacheManager otherCacheManager=provider.getCacheManager(uri,provider.getDefaultClassLoader());
  assertFalse(otherCacheManager.isClosed());
  assertNotSame(cacheManager,otherCacheManager);
}

Fixed version (ground truth):
@Test public void testReuseCacheManager() throws Exception {
  CachingProvider provider=Caching.getCachingProvider();
  URI uri=provider.getDefaultURI();
  CacheManager cacheManager=provider.getCacheManager(uri,provider.getDefaultClassLoader());
  assertFalse(cacheManager.isClosed());
  cacheManager.close();
  assertTrue(cacheManager.isClosed());
  try {
    cacheManager.configureCache("String_Node_Str",null);
    fail();
  }
 catch (  IllegalStateException e) {
  }
  CacheManager otherCacheManager=provider.getCacheManager(uri,provider.getDefaultClassLoader());
  assertFalse(otherCacheManager.isClosed());
  assertNotSame(cacheManager,otherCacheManager);
}
Program: 19374
Project: 19374
Buggy source:
/** 
 * Multiple invocations of   {@link CachingProvider#getCacheManager(java.net.URI,ClassLoader)} with the same namereturn the same CacheManager instance
 */
@Test public void getCacheManager_URI() throws Exception {
  CachingProvider provider=Caching.getCachingProvider();
  URI uri=new URI("String_Node_Str");
  CacheManager manager=provider.getCacheManager(uri,provider.getDefaultClassLoader());
  assertNotNull(manager);
  assertSame(manager,provider.getCacheManager(uri,provider.getDefaultClassLoader()));
  assertEquals(uri,manager.getURI());
}

Fixed version (ground truth):
/** 
 * Multiple invocations of   {@link CachingProvider#getCacheManager(java.net.URI,ClassLoader)} with the same namereturn the same CacheManager instance
 */
@Test public void getCacheManager_URI() throws Exception {
  CachingProvider provider=Caching.getCachingProvider();
  URI uri=provider.getDefaultURI();
  CacheManager manager=provider.getCacheManager(uri,provider.getDefaultClassLoader());
  assertNotNull(manager);
  assertSame(manager,provider.getCacheManager(uri,provider.getDefaultClassLoader()));
  assertEquals(uri,manager.getURI());
}
Program: 19375
Project: 19375
Buggy source:
/** 
 * Obtains a CacheManager using a string-based name from the default CachingProvider.
 * @param name the name of the CacheManager
 * @return a CacheManager
 * @throws Exception
 */
public static CacheManager getCacheManager(String name) throws Exception {
  URI uri=new URI(name);
  CachingProvider provider=Caching.getCachingProvider();
  return Caching.getCachingProvider().getCacheManager(uri,provider.getDefaultClassLoader());
}

Fixed version (ground truth):
/** 
 * Obtains a CacheManager using a string-based name from the default CachingProvider.
 * @return a CacheManager
 * @throws Exception
 */
public static CacheManager getCacheManager() throws Exception {
  CachingProvider provider=Caching.getCachingProvider();
  URI uri=provider.getDefaultURI();
  return Caching.getCachingProvider().getCacheManager(uri,provider.getDefaultClassLoader());
}
Program: 19376
Project: 19376
Buggy source:
/** 
 * setup test
 */
@Before public void setUp() throws Exception {
  cacheManager=getCacheManager(this.getClass().getName() + System.nanoTime());
}

Fixed version (ground truth):
/** 
 * setup test
 */
@Before public void setUp() throws Exception {
  Caching.getCachingProvider().close();
  cacheManager=getCacheManager();
}
Program: 19377
Project: 19377
Buggy source:
/** 
 * To view in JConsole, start main then run JConsole and connect then go to the MBeans tab and expand javax.cache.&lt;CacheManager&gt;
 */
public static void main(String[] args) throws Exception {
  System.out.println("String_Node_Str");
  CacheManager cacheManager1=getCacheManager("String_Node_Str");
  CacheManager cacheManager2=getCacheManager("String_Node_Str");
  try {
    MBeanServer mBeanServer=ManagementFactory.getPlatformMBeanServer();
    MutableConfiguration configuration=new MutableConfiguration().setStatisticsEnabled(true).setManagementEnabled(true);
    cacheManager1.configureCache("String_Node_Str",configuration);
    cacheManager1.configureCache("String_Node_Str",configuration);
    cacheManager2.configureCache("String_Node_Str",configuration);
    cacheManager2.configureCache("String_Node_Str",configuration);
    ObjectName search=new ObjectName("String_Node_Str");
    System.out.println("String_Node_Str" + mBeanServer.queryNames(search,null).size());
    Thread.sleep(60 * 10000);
    System.out.println("String_Node_Str");
  }
  finally {
    cacheManager1.close();
    cacheManager2.close();
  }
}

Fixed version (ground truth):
/** 
 * To view in JConsole, start main then run JConsole and connect then go to the MBeans tab and expand javax.cache.&lt;CacheManager&gt;
 */
public static void main(String[] args) throws Exception {
  System.out.println("String_Node_Str");
  CacheManager cacheManager1=getCacheManager();
  CacheManager cacheManager2=getCacheManager();
  try {
    MBeanServer mBeanServer=ManagementFactory.getPlatformMBeanServer();
    MutableConfiguration configuration=new MutableConfiguration().setStatisticsEnabled(true).setManagementEnabled(true);
    cacheManager1.configureCache("String_Node_Str",configuration);
    cacheManager1.configureCache("String_Node_Str",configuration);
    cacheManager2.configureCache("String_Node_Str",configuration);
    cacheManager2.configureCache("String_Node_Str",configuration);
    ObjectName search=new ObjectName("String_Node_Str");
    System.out.println("String_Node_Str" + mBeanServer.queryNames(search,null).size());
    Thread.sleep(60 * 10000);
    System.out.println("String_Node_Str");
  }
  finally {
    cacheManager1.close();
    cacheManager2.close();
  }
}
Program: 19378
Project: 19378
Buggy source:
@Test public void testMultipleCacheManagers() throws Exception {
  cacheManager.configureCache("String_Node_Str",configuration);
  assertThat(mBeanServer.queryNames(new ObjectName("String_Node_Str"),null),hasSize(2));
  CacheManager cacheManager2=getCacheManager("String_Node_Str");
  cacheManager2.configureCache("String_Node_Str",configuration);
  assertThat(mBeanServer.queryNames(new ObjectName("String_Node_Str"),null),hasSize(4));
  cacheManager2.close();
}

Fixed version (ground truth):
@Test public void testMultipleCacheManagers() throws Exception {
  cacheManager.configureCache("String_Node_Str",configuration);
  assertThat(mBeanServer.queryNames(new ObjectName("String_Node_Str"),null),hasSize(2));
  CacheManager cacheManager2=getCacheManager();
  cacheManager2.configureCache("String_Node_Str",configuration);
  assertThat(mBeanServer.queryNames(new ObjectName("String_Node_Str"),null),hasSize(4));
  cacheManager2.close();
}
Program: 19379
Project: 19379
Buggy source:
/** 
 * Closing a single CacheManager from a CachingProvider when there are multiple available across different ClassLoaders.
 */
@Test public void closeCacheManager() throws Exception {
  ClassLoader contextLoader=Thread.currentThread().getContextClassLoader();
  CachingProvider provider=Caching.getCachingProvider(contextLoader);
  URI uri=new URI("String_Node_Str");
  ClassLoader loader1=new MyClassLoader(contextLoader);
  CacheManager manager1=provider.getCacheManager(uri,loader1);
  ClassLoader loader2=new MyClassLoader(contextLoader);
  CacheManager manager2=provider.getCacheManager(uri,loader2);
  ClassLoader loader3=new MyClassLoader(contextLoader);
  CacheManager manager3=provider.getCacheManager(uri,loader3);
  provider.close(manager2.getURI(),loader2);
  assertSame(manager1,provider.getCacheManager(uri,loader1));
  assertNotSame(manager2,provider.getCacheManager(uri,loader2));
  assertSame(manager3,provider.getCacheManager(uri,loader3));
}

Fixed version (ground truth):
/** 
 * Closing a single CacheManager from a CachingProvider when there are multiple available across different ClassLoaders.
 */
@Test public void closeCacheManager() throws Exception {
  ClassLoader contextLoader=Thread.currentThread().getContextClassLoader();
  CachingProvider provider=Caching.getCachingProvider(contextLoader);
  URI uri=provider.getDefaultURI();
  ClassLoader loader1=new MyClassLoader(contextLoader);
  CacheManager manager1=provider.getCacheManager(uri,loader1);
  ClassLoader loader2=new MyClassLoader(contextLoader);
  CacheManager manager2=provider.getCacheManager(uri,loader2);
  ClassLoader loader3=new MyClassLoader(contextLoader);
  CacheManager manager3=provider.getCacheManager(uri,loader3);
  provider.close(manager2.getURI(),loader2);
  assertSame(manager1,provider.getCacheManager(uri,loader1));
  assertNotSame(manager2,provider.getCacheManager(uri,loader2));
  assertSame(manager3,provider.getCacheManager(uri,loader3));
}
Program: 19380
Project: 19380
Buggy source:
/** 
 * Close all CacheManagers from a CachingProvider, each CacheManager being based on a different ClassLoader.
 */
@Test public void closeAllCacheManagers() throws Exception {
  ClassLoader contextLoader=Thread.currentThread().getContextClassLoader();
  CachingProvider provider=Caching.getCachingProvider(contextLoader);
  URI uri=new URI("String_Node_Str");
  ClassLoader loader1=new MyClassLoader(contextLoader);
  CacheManager manager1=provider.getCacheManager(uri,loader1);
  ClassLoader loader2=new MyClassLoader(contextLoader);
  CacheManager manager2=provider.getCacheManager(uri,loader2);
  ClassLoader loader3=new MyClassLoader(contextLoader);
  CacheManager manager3=provider.getCacheManager(uri,loader3);
  provider.close();
  assertNotSame(manager1,provider.getCacheManager(uri,loader1));
  assertNotSame(manager2,provider.getCacheManager(uri,loader2));
  assertNotSame(manager3,provider.getCacheManager(uri,loader3));
}

Fixed version (ground truth):
/** 
 * Close all CacheManagers from a CachingProvider, each CacheManager being based on a different ClassLoader.
 */
@Test public void closeAllCacheManagers() throws Exception {
  ClassLoader contextLoader=Thread.currentThread().getContextClassLoader();
  CachingProvider provider=Caching.getCachingProvider(contextLoader);
  URI uri=provider.getDefaultURI();
  ClassLoader loader1=new MyClassLoader(contextLoader);
  CacheManager manager1=provider.getCacheManager(uri,loader1);
  ClassLoader loader2=new MyClassLoader(contextLoader);
  CacheManager manager2=provider.getCacheManager(uri,loader2);
  ClassLoader loader3=new MyClassLoader(contextLoader);
  CacheManager manager3=provider.getCacheManager(uri,loader3);
  provider.close();
  assertNotSame(manager1,provider.getCacheManager(uri,loader1));
  assertNotSame(manager2,provider.getCacheManager(uri,loader2));
  assertNotSame(manager3,provider.getCacheManager(uri,loader3));
}
Program: 19381
Project: 19381
Buggy source:
/** 
 * Attempt to close CacheManagers using URIs and/or ClassLoaders that don't have associated CacheManagers.
 */
@Test public void closeClassLoader() throws Exception {
  ClassLoader contextLoader=Thread.currentThread().getContextClassLoader();
  CachingProvider provider=Caching.getCachingProvider(contextLoader);
  URI uri=new URI("String_Node_Str");
  ClassLoader loader1=new MyClassLoader(contextLoader);
  CacheManager manager1=provider.getCacheManager(uri,loader1);
  ClassLoader loader2=new MyClassLoader(contextLoader);
  CacheManager manager2=provider.getCacheManager(uri,loader2);
  ClassLoader loader3=new MyClassLoader(contextLoader);
  CacheManager manager3=provider.getCacheManager(uri,loader3);
  provider.close(contextLoader);
  provider.close(provider.getDefaultURI(),loader1);
  provider.close(provider.getDefaultURI(),loader2);
  provider.close(provider.getDefaultURI(),loader3);
  assertSame(manager1,provider.getCacheManager(uri,loader1));
  assertSame(manager2,provider.getCacheManager(uri,loader2));
  assertSame(manager3,provider.getCacheManager(uri,loader3));
}

Fixed version (ground truth):
/** 
 * Attempt to close CacheManagers using URIs and/or ClassLoaders that don't have associated CacheManagers.
 */
@Test public void closeClassLoader() throws Exception {
  ClassLoader contextLoader=Thread.currentThread().getContextClassLoader();
  CachingProvider provider=Caching.getCachingProvider(contextLoader);
  URI uri=provider.getDefaultURI();
  ClassLoader loader1=new MyClassLoader(contextLoader);
  CacheManager manager1=provider.getCacheManager(uri,loader1);
  ClassLoader loader2=new MyClassLoader(contextLoader);
  CacheManager manager2=provider.getCacheManager(uri,loader2);
  ClassLoader loader3=new MyClassLoader(contextLoader);
  CacheManager manager3=provider.getCacheManager(uri,loader3);
  provider.close(contextLoader);
  provider.close(provider.getDefaultURI(),contextLoader);
  provider.close(provider.getDefaultURI(),contextLoader);
  provider.close(provider.getDefaultURI(),contextLoader);
  assertSame(manager1,provider.getCacheManager(uri,loader1));
  assertSame(manager2,provider.getCacheManager(uri,loader2));
  assertSame(manager3,provider.getCacheManager(uri,loader3));
}
Program: 19383
Project: 19383
Buggy source:
/** 
 * Ensure that a cache using a   {@link javax.cache.ExpiryPolicy} configured toreturn a  {@link Duration#ZERO} for newly created entries will immediately expire said entries.
 */
@Test public void expire_whenCreated(){
  MutableConfiguration<Integer,Integer> config=new MutableConfiguration<Integer,Integer>();
  config.setExpiryPolicy(new ParameterizedExpiryPolicy<Integer,Integer>(Duration.ZERO,null,null));
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),config);
  cache.put(1,1);
  assertFalse(cache.containsKey(1));
  assertNull(cache.get(1));
  cache.put(1,1);
  assertFalse(cache.remove(1));
  cache.put(1,1);
  assertFalse(cache.remove(1,1));
  cache.getAndPut(1,1);
  assertFalse(cache.containsKey(1));
  assertNull(cache.get(1));
  cache.putIfAbsent(1,1);
  assertFalse(cache.containsKey(1));
  assertNull(cache.get(1));
  HashMap<Integer,Integer> map=new HashMap<Integer,Integer>();
  map.put(1,1);
  cache.putAll(map);
  assertFalse(cache.containsKey(1));
  assertNull(cache.get(1));
  cache.put(1,1);
  assertFalse(cache.iterator().hasNext());
}

Fixed version (ground truth):
/** 
 * Ensure that a cache using a   {@link javax.cache.ExpiryPolicy} configured toreturn a  {@link Duration#ZERO} for newly created entries will immediately expire said entries.
 */
@Test public void expire_whenCreated(){
  MutableConfiguration<Integer,Integer> config=new MutableConfiguration<Integer,Integer>();
  config.setExpiryPolicyFactory(Factories.of(new ParameterizedExpiryPolicy<Integer,Integer>(Duration.ZERO,null,null)));
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),config);
  cache.put(1,1);
  assertFalse(cache.containsKey(1));
  assertNull(cache.get(1));
  cache.put(1,1);
  assertFalse(cache.remove(1));
  cache.put(1,1);
  assertFalse(cache.remove(1,1));
  cache.getAndPut(1,1);
  assertFalse(cache.containsKey(1));
  assertNull(cache.get(1));
  cache.putIfAbsent(1,1);
  assertFalse(cache.containsKey(1));
  assertNull(cache.get(1));
  HashMap<Integer,Integer> map=new HashMap<Integer,Integer>();
  map.put(1,1);
  cache.putAll(map);
  assertFalse(cache.containsKey(1));
  assertNull(cache.get(1));
  cache.put(1,1);
  assertFalse(cache.iterator().hasNext());
}
Program: 19385
Project: 19385
Buggy source:
protected <A,B>MutableConfiguration<A,B> extraSetup(MutableConfiguration<A,B> configuration){
  return configuration.setExpiryPolicy(new ExpiryPolicy.Modified(new Configuration.Duration(TimeUnit.MILLISECONDS,20)));
}

Fixed version (ground truth):
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))));
}
Program: 19386
Project: 19386
Buggy source:
@Test public void getAndRemove_NotExistent(){
  SimpleCacheLoader<Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoader(loader));
  Integer key=1;
  assertNull(cache.getAndRemove(key));
  assertFalse(cache.containsKey(key));
}

Fixed version (ground truth):
@Test public void getAndRemove_NotExistent(){
  SimpleCacheLoader<Integer> loader=new SimpleCacheLoader<Integer>();
  Cache<Integer,Integer> cache=getCacheManager().configureCache(getTestCacheName(),new MutableConfiguration<Integer,Integer>().setCacheLoaderFactory(Factories.of(loader)));
  Integer key=1;
  assertNull(cache.getAndRemove(key));
  assertFalse(cache.containsKey(key));
}
Program: 19387
Project: 19387
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>().setCacheLoader(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),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: 19388
Project: 19388
Buggy source:
@Test public void replace_2arg(){
  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,value3));
  assertEquals(value3,cache.get(key));
}

Fixed version (ground truth):
@Test public void replace_2arg(){
  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,value3));
  assertEquals(value3,cache.get(key));
}
Program: 19389
Project: 19389
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>().setCacheLoader(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,future);
  future.get(FUTURE_WAIT_MILLIS,TimeUnit.MILLISECONDS);
  assertTrue(future.isDone());
  for (  Integer key : keys) {
    assertEquals(key,cache.get(key));
  }
}
Program: 19390
Project: 19390
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>().setCacheLoader(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,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));
}