nus-yam/ex-repair huggingface dataset:
Program: 19303
Project: 19303
Buggy source:
/** 
 * What happens when you: 1) don't declare using generics and 2) don't specify types during configuration.
 */
@Test public void simpleAPINoGenericsAndNoTypeEnforcementStoreByReference(){
  MutableConfiguration config=new MutableConfiguration().setStoreByValue(false);
  Cache cache=cacheManager.createCache(cacheName,config);
  Identifier2 one=new Identifier2("String_Node_Str");
  cache.put(one,"String_Node_Str");
  cache.put(pistachio.getName(),pistachio);
  cache.put(tonto.getName(),tonto);
  cache.put(bonzo.getName(),bonzo);
  cache.put(juno.getName(),juno);
  cache.put(talker.getName(),talker);
  try {
    cache.put(skinny.getName(),skinny);
  }
 catch (  Exception e) {
  }
  Identifier2 one_=new Identifier2("String_Node_Str");
  Assert.assertEquals(one,one_);
  Assert.assertEquals(one.hashCode(),one_.hashCode());
  assertNotNull(cache.get(one_));
  assertNotNull(cache.get(one));
  assertNotNull(cache.get(pistachio.getName()));
  assertTrue(cache.remove(one));
  assertTrue(cache.remove(pistachio.getName()));
}

Fixed version (ground truth):
/** 
 * What happens when you: 1) don't declare using generics and 2) don't specify types during configuration.
 */
@Test public void simpleAPINoGenericsAndNoTypeEnforcementStoreByReference(){
  if (cacheManager.getCachingProvider().isSupported(OptionalFeature.STORE_BY_REFERENCE)) {
    MutableConfiguration config=new MutableConfiguration().setStoreByValue(false);
    Cache cache=cacheManager.createCache(cacheName,config);
    Identifier2 one=new Identifier2("String_Node_Str");
    cache.put(one,"String_Node_Str");
    cache.put(pistachio.getName(),pistachio);
    cache.put(tonto.getName(),tonto);
    cache.put(bonzo.getName(),bonzo);
    cache.put(juno.getName(),juno);
    cache.put(talker.getName(),talker);
    try {
      cache.put(skinny.getName(),skinny);
    }
 catch (    Exception e) {
    }
    Identifier2 one_=new Identifier2("String_Node_Str");
    Assert.assertEquals(one,one_);
    Assert.assertEquals(one.hashCode(),one_.hashCode());
    assertNotNull(cache.get(one_));
    assertNotNull(cache.get(one));
    assertNotNull(cache.get(pistachio.getName()));
    assertTrue(cache.remove(one));
    assertTrue(cache.remove(pistachio.getName()));
  }
}
Program: 19304
Project: 19304
Buggy source:
/** 
 * What happens when you: 1) don't declare using generics and 2) don't specify types during configuration.
 */
@Test public void simpleAPINoGenericsAndNoTypeEnforcementStoreByReference(){
  MutableConfiguration config=new MutableConfiguration().setStoreByValue(false);
  Cache cache=cacheManager.createCache(cacheName,config);
  Identifier2 one=new Identifier2("String_Node_Str");
  cache.put(one,"String_Node_Str");
  cache.put(pistachio.getName(),pistachio);
  cache.put(tonto.getName(),tonto);
  cache.put(bonzo.getName(),bonzo);
  cache.put(juno.getName(),juno);
  cache.put(talker.getName(),talker);
  try {
    cache.put(skinny.getName(),skinny);
  }
 catch (  Exception e) {
  }
  Identifier2 one_=new Identifier2("String_Node_Str");
  Assert.assertEquals(one,one_);
  Assert.assertEquals(one.hashCode(),one_.hashCode());
  assertNotNull(cache.get(one_));
  assertNotNull(cache.get(one));
  assertNotNull(cache.get(pistachio.getName()));
  assertTrue(cache.remove(one));
  assertTrue(cache.remove(pistachio.getName()));
}

Fixed version (ground truth):
/** 
 * What happens when you: 1) don't declare using generics and 2) don't specify types during configuration.
 */
@Test public void simpleAPINoGenericsAndNoTypeEnforcementStoreByReference(){
  if (cacheManager.getCachingProvider().isSupported(OptionalFeature.STORE_BY_REFERENCE)) {
    MutableConfiguration config=new MutableConfiguration().setStoreByValue(false);
    Cache cache=cacheManager.createCache(cacheName,config);
    Identifier2 one=new Identifier2("String_Node_Str");
    cache.put(one,"String_Node_Str");
    cache.put(pistachio.getName(),pistachio);
    cache.put(tonto.getName(),tonto);
    cache.put(bonzo.getName(),bonzo);
    cache.put(juno.getName(),juno);
    cache.put(talker.getName(),talker);
    try {
      cache.put(skinny.getName(),skinny);
    }
 catch (    Exception e) {
    }
    Identifier2 one_=new Identifier2("String_Node_Str");
    Assert.assertEquals(one,one_);
    Assert.assertEquals(one.hashCode(),one_.hashCode());
    assertNotNull(cache.get(one_));
    assertNotNull(cache.get(one));
    assertNotNull(cache.get(pistachio.getName()));
    assertTrue(cache.remove(one));
    assertTrue(cache.remove(pistachio.getName()));
  }
}
Program: 19305
Project: 19305
Buggy source:
/** 
 * What happens when you: 1) don't declare using generics and 2) don't specify types during configuration.
 */
@Test public void simpleAPINoGenericsAndNoTypeEnforcementStoreByReference(){
  if (cacheManager.getCachingProvider().isSupported(OptionalFeature.STORE_BY_REFERENCE)) {
    MutableConfiguration config=new MutableConfiguration().setStoreByValue(false);
    Cache cache=cacheManager.createCache(cacheName,config);
    Identifier2 one=new Identifier2("String_Node_Str");
    cache.put(one,"String_Node_Str");
    cache.put(pistachio.getName(),pistachio);
    cache.put(tonto.getName(),tonto);
    cache.put(bonzo.getName(),bonzo);
    cache.put(juno.getName(),juno);
    cache.put(talker.getName(),talker);
    try {
      cache.put(skinny.getName(),skinny);
    }
 catch (    Exception e) {
    }
    Identifier2 one_=new Identifier2("String_Node_Str");
    Assert.assertEquals(one,one_);
    Assert.assertEquals(one.hashCode(),one_.hashCode());
    assertNotNull(cache.get(one_));
    assertNotNull(cache.get(one));
    assertNotNull(cache.get(pistachio.getName()));
    assertTrue(cache.remove(one));
    assertTrue(cache.remove(pistachio.getName()));
  }
}

Fixed version (ground truth):
/** 
 * What happens when you: 1) don't declare using generics and 2) don't specify types during configuration.
 */
@Test public void simpleAPINoGenericsAndNoTypeEnforcementStoreByReference(){
  MutableConfiguration config=new MutableConfiguration().setStoreByValue(false);
  Cache cache=cacheManager.createCache(cacheName,config);
  Identifier2 one=new Identifier2("String_Node_Str");
  cache.put(one,"String_Node_Str");
  cache.put(pistachio.getName(),pistachio);
  cache.put(tonto.getName(),tonto);
  cache.put(bonzo.getName(),bonzo);
  cache.put(juno.getName(),juno);
  cache.put(talker.getName(),talker);
  try {
    cache.put(skinny.getName(),skinny);
  }
 catch (  Exception e) {
  }
  Identifier2 one_=new Identifier2("String_Node_Str");
  Assert.assertEquals(one,one_);
  Assert.assertEquals(one.hashCode(),one_.hashCode());
  assertNotNull(cache.get(one_));
  assertNotNull(cache.get(one));
  assertNotNull(cache.get(pistachio.getName()));
  assertTrue(cache.remove(one));
  assertTrue(cache.remove(pistachio.getName()));
}
Program: 19306
Project: 19306
Buggy source:
@Test public void removeException(){
  final Integer key=123;
  final String oldValue="String_Node_Str";
  cache.put(key,oldValue);
  try {
    cache.invoke(key,new ThrowExceptionEntryProcessor<Integer,String,Void>(IllegalAccessError.class));
    fail();
  }
 catch (  CacheException e) {
    assertTrue("String_Node_Str" + e.getCause(),e.getCause().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.put(key,oldValue);
  try {
    cache.invoke(key,new ThrowExceptionEntryProcessor<Integer,String,Void>(IllegalAccessError.class));
    fail();
  }
 catch (  CacheException e) {
    assertTrue("String_Node_Str" + e.getCause(),e.getCause() instanceof IllegalAccessError);
  }
  assertEquals(oldValue,cache.get(key));
}
Program: 19307
Project: 19307
Buggy source:
@Test public void noValueException(){
  final Integer key=123;
  final String setValue="String_Node_Str";
  EntryProcessor processors[]=new EntryProcessor[]{new AssertNotPresentEntryProcessor(null),new SetEntryProcessor<Integer,String>(setValue),new ThrowExceptionEntryProcessor<Integer,String,String>(IllegalAccessError.class)};
  try {
    cache.invoke(key,new CombineEntryProcessor(processors));
    fail();
  }
 catch (  CacheException e) {
    assertTrue("String_Node_Str" + e.getCause(),e.getCause().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";
  EntryProcessor processors[]=new EntryProcessor[]{new AssertNotPresentEntryProcessor(null),new SetEntryProcessor<Integer,String>(setValue),new ThrowExceptionEntryProcessor<Integer,String,String>(IllegalAccessError.class)};
  try {
    cache.invoke(key,new CombineEntryProcessor(processors));
    fail();
  }
 catch (  CacheException e) {
    assertTrue("String_Node_Str" + e.getCause(),e.getCause() instanceof IllegalAccessError);
  }
  assertFalse(cache.containsKey(key));
}
Program: 19308
Project: 19308
Buggy source:
@Test public void existingException(){
  final Integer key=123;
  final String oldValue="String_Node_Str";
  final String newValue="String_Node_Str";
  cache.put(key,oldValue);
  EntryProcessor processors[]=new EntryProcessor[]{new ReplaceEntryProcessor<Integer,String,Integer>(oldValue,newValue),new ThrowExceptionEntryProcessor<Integer,String,String>(IllegalAccessError.class)};
  try {
    cache.invoke(key,new CombineEntryProcessor<Integer,String>(processors));
    fail();
  }
 catch (  CacheException e) {
    assertTrue("String_Node_Str" + e.getCause(),e.getCause().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.put(key,oldValue);
  EntryProcessor processors[]=new EntryProcessor[]{new ReplaceEntryProcessor<Integer,String,Integer>(oldValue,newValue),new ThrowExceptionEntryProcessor<Integer,String,String>(IllegalAccessError.class)};
  try {
    cache.invoke(key,new CombineEntryProcessor<Integer,String>(processors));
    fail();
  }
 catch (  CacheException e) {
    assertTrue("String_Node_Str" + e.getCause(),e.getCause() instanceof IllegalAccessError);
  }
  assertEquals(oldValue,cache.get(key));
}
Program: 19309
Project: 19309
Buggy source:
@Test public void removeSpecifiedEntryShouldNotCallExpiryPolicyMethods(){
  CountingExpiryPolicy expiryPolicy=new CountingExpiryPolicy();
  expiryPolicyServer.setExpiryPolicy(expiryPolicy);
  MutableConfiguration<Integer,Integer> config=new MutableConfiguration<>();
  config.setExpiryPolicyFactory(FactoryBuilder.factoryOf(expiryPolicyClient));
  Cache<Integer,Integer> cache=getCacheManager().createCache(getTestCacheName(),config);
  boolean result=cache.remove(1,1);
  assertThat(expiryPolicy.getCreationCount(),is(0));
  assertThat(expiryPolicy.getAccessCount(),is(0));
  assertThat(expiryPolicy.getUpdatedCount(),is(0));
  cache.put(1,1);
  assertThat(expiryPolicy.getCreationCount(),greaterThanOrEqualTo(1));
  assertThat(expiryPolicy.getAccessCount(),is(0));
  assertThat(expiryPolicy.getUpdatedCount(),is(0));
  expiryPolicy.resetCount();
  result=cache.remove(1,1);
  assertTrue(result);
  assertThat(expiryPolicy.getCreationCount(),is(0));
  assertThat(expiryPolicy.getAccessCount(),is(0));
  assertThat(expiryPolicy.getUpdatedCount(),is(0));
}

Fixed version (ground truth):
@Test public void removeSpecifiedEntryShouldNotCallExpiryPolicyMethods(){
  CountingExpiryPolicy expiryPolicy=new CountingExpiryPolicy();
  expiryPolicyServer.setExpiryPolicy(expiryPolicy);
  MutableConfiguration<Integer,Integer> config=new MutableConfiguration<>();
  config.setExpiryPolicyFactory(FactoryBuilder.factoryOf(expiryPolicyClient));
  Cache<Integer,Integer> cache=getCacheManager().createCache(getTestCacheName(),config);
  boolean result=cache.remove(1,1);
  assertThat(expiryPolicy.getCreationCount(),is(0));
  assertThat(expiryPolicy.getAccessCount(),is(0));
  assertThat(expiryPolicy.getUpdatedCount(),is(0));
  cache.put(1,1);
  assertThat(expiryPolicy.getCreationCount(),greaterThanOrEqualTo(1));
  assertThat(expiryPolicy.getAccessCount(),is(0));
  assertThat(expiryPolicy.getUpdatedCount(),is(0));
  expiryPolicy.resetCount();
  result=cache.remove(1,2);
  assertFalse(result);
  assertThat(expiryPolicy.getCreationCount(),is(0));
  assertThat(expiryPolicy.getAccessCount(),is(1));
  assertThat(expiryPolicy.getUpdatedCount(),is(0));
  expiryPolicy.resetCount();
  result=cache.remove(1,1);
  assertTrue(result);
  assertThat(expiryPolicy.getCreationCount(),is(0));
  assertThat(expiryPolicy.getAccessCount(),is(0));
  assertThat(expiryPolicy.getUpdatedCount(),is(0));
}
Program: 19310
Project: 19310
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Duration onInvoke(ObjectInputStream ois,ObjectOutputStream oos) throws IOException, ClassNotFoundException {
  oos.writeObject(key);
  Object o=ois.readObject();
  if (o instanceof RuntimeException) {
    throw (RuntimeException)o;
  }
 else {
    return (Duration)o;
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Duration onInvoke(ObjectInputStream ois,ObjectOutputStream oos) throws IOException, ClassNotFoundException {
  oos.writeObject(entryOperation.name());
  Object o=ois.readObject();
  if (o instanceof RuntimeException) {
    throw (RuntimeException)o;
  }
 else {
    return (Duration)o;
  }
}
Program: 19311
Project: 19311
Buggy source:
public T process(MutableEntry<K,V> entry,Object... arguments){
  return (T)entry.getValue();
}

Fixed version (ground truth):
@Override public T process(MutableEntry<K,V> entry,Object... arguments){
  return (T)entry.getValue();
}
Program: 19312
Project: 19312
Buggy source:
@Override public T process(MutableEntry<K,V> entry,Object... arguments){
  return (T)entry.getValue();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public V process(MutableEntry<K,V> entry,Object... arguments){
  return entry.getValue();
}
Program: 19313
Project: 19313
Buggy source:
public V getValue(){
  return value;
}

Fixed version (ground truth):
/** 
 * Obtains the value to set.
 * @return the value to set
 */
public V getValue(){
  return value;
}
Program: 19314
Project: 19314
Buggy source:
@Override public T process(MutableEntry<K,V> entry,Object... arguments){
  entry.setValue(value);
  return (T)entry.getValue();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public V process(MutableEntry<K,V> entry,Object... arguments){
  entry.setValue(value);
  return entry.getValue();
}
Program: 19315
Project: 19315
Buggy source:
public SetEntryProcessor(V value){
  this.value=value;
}

Fixed version (ground truth):
/** 
 * Constructs a   {@link SetEntryProcessor}.
 * @param value
 */
public SetEntryProcessor(V value){
  this.value=value;
}
Program: 19316
Project: 19316
Buggy source:
@Override public T process(MutableEntry<K,V> entry,Object... arguments){
  Assert.assertFalse(entry.exists());
  super.process(entry,arguments);
  Assert.assertTrue(entry.exists());
  return ret;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public T process(MutableEntry<K,V> entry,Object... arguments){
  Assert.assertFalse(entry.exists());
  entry.setValue(value);
  Assert.assertTrue(entry.exists());
  return result;
}
Program: 19317
Project: 19317
Buggy source:
public SetValueCreateEntryReturnDifferentTypeEntryProcessor(T ret,V newValue){
  super(newValue);
  this.ret=ret;
}

Fixed version (ground truth):
/** 
 * Constructs a   {@link SetValueCreateEntryReturnDifferentTypeEntryProcessor}.
 * @param result
 * @param newValue
 */
public SetValueCreateEntryReturnDifferentTypeEntryProcessor(T result,V newValue){
  this.value=newValue;
  this.result=result;
}
Program: 19320
Project: 19320
Buggy source:
@Test public void invokeGetValueShouldCallGetExpiry(){
  CountingExpiryPolicy expiryPolicy=new CountingExpiryPolicy();
  expiryPolicyServer.setExpiryPolicy(expiryPolicy);
  MutableConfiguration<Integer,Integer> config=new MutableConfiguration<>();
  config.setExpiryPolicyFactory(FactoryBuilder.factoryOf(expiryPolicyClient));
  Cache<Integer,Integer> cache=getCacheManager().createCache(getTestCacheName(),config);
  final Integer key=123;
  final Integer setValue=456;
  Integer resultValue=cache.invoke(key,new GetEntryProcessor<Integer,Integer,Integer>());
  assertEquals(null,resultValue);
  assertThat(expiryPolicy.getCreationCount(),is(0));
  assertThat(expiryPolicy.getAccessCount(),is(0));
  assertThat(expiryPolicy.getUpdatedCount(),is(0));
  resultValue=cache.invoke(key,new SetEntryProcessor<Integer,Integer,Integer>(setValue));
  assertEquals(resultValue,setValue);
  assertThat(expiryPolicy.getCreationCount(),greaterThanOrEqualTo(1));
  assertThat(expiryPolicy.getAccessCount(),is(0));
  assertThat(expiryPolicy.getUpdatedCount(),is(0));
  expiryPolicy.resetCount();
  resultValue=cache.invoke(key,new GetEntryProcessor<Integer,Integer,Integer>());
  assertEquals(setValue,resultValue);
  assertThat(expiryPolicy.getCreationCount(),is(0));
  assertThat(expiryPolicy.getAccessCount(),greaterThanOrEqualTo(1));
  assertThat(expiryPolicy.getUpdatedCount(),is(0));
}

Fixed version (ground truth):
@Test public void invokeGetValueShouldCallGetExpiry(){
  CountingExpiryPolicy expiryPolicy=new CountingExpiryPolicy();
  expiryPolicyServer.setExpiryPolicy(expiryPolicy);
  MutableConfiguration<Integer,Integer> config=new MutableConfiguration<>();
  config.setExpiryPolicyFactory(FactoryBuilder.factoryOf(expiryPolicyClient));
  Cache<Integer,Integer> cache=getCacheManager().createCache(getTestCacheName(),config);
  final Integer key=123;
  final Integer setValue=456;
  Integer resultValue=cache.invoke(key,new GetEntryProcessor<Integer,Integer>());
  assertEquals(null,resultValue);
  assertThat(expiryPolicy.getCreationCount(),is(0));
  assertThat(expiryPolicy.getAccessCount(),is(0));
  assertThat(expiryPolicy.getUpdatedCount(),is(0));
  resultValue=cache.invoke(key,new SetEntryProcessor<Integer,Integer>(setValue));
  assertEquals(resultValue,setValue);
  assertThat(expiryPolicy.getCreationCount(),greaterThanOrEqualTo(1));
  assertThat(expiryPolicy.getAccessCount(),is(0));
  assertThat(expiryPolicy.getUpdatedCount(),is(0));
  expiryPolicy.resetCount();
  resultValue=cache.invoke(key,new GetEntryProcessor<Integer,Integer>());
  assertEquals(setValue,resultValue);
  assertThat(expiryPolicy.getCreationCount(),is(0));
  assertThat(expiryPolicy.getAccessCount(),greaterThanOrEqualTo(1));
  assertThat(expiryPolicy.getUpdatedCount(),is(0));
}
Program: 19321
Project: 19321
Buggy source:
@Test public void invokeMultiSetValueShouldCallGetExpiry(){
  CountingExpiryPolicy expiryPolicy=new CountingExpiryPolicy();
  expiryPolicyServer.setExpiryPolicy(expiryPolicy);
  MutableConfiguration<Integer,Integer> config=new MutableConfiguration<>();
  config.setExpiryPolicyFactory(FactoryBuilder.factoryOf(expiryPolicyClient));
  Cache<Integer,Integer> cache=getCacheManager().createCache(getTestCacheName(),config);
  final Integer key=123;
  final Integer setValue=456;
  final Integer modifySetValue=789;
  EntryProcessor processors[]=new EntryProcessor[]{new AssertNotPresentEntryProcessor(null),new SetEntryProcessor<Integer,Integer,Integer>(111),new SetEntryProcessor<Integer,Integer,Integer>(setValue),new GetEntryProcessor<Integer,Integer,Integer>()};
  Object[] result=(Object[])cache.invoke(key,new CombineEntryProcessor(processors));
  assertEquals(result[1],111);
  assertEquals(result[2],setValue);
  assertEquals(result[3],setValue);
  assertThat(expiryPolicy.getCreationCount(),greaterThanOrEqualTo(1));
  assertThat(expiryPolicy.getAccessCount(),greaterThanOrEqualTo(0));
  assertThat(expiryPolicy.getUpdatedCount(),greaterThanOrEqualTo(0));
}

Fixed version (ground truth):
@Test public void invokeMultiSetValueShouldCallGetExpiry(){
  CountingExpiryPolicy expiryPolicy=new CountingExpiryPolicy();
  expiryPolicyServer.setExpiryPolicy(expiryPolicy);
  MutableConfiguration<Integer,Integer> config=new MutableConfiguration<>();
  config.setExpiryPolicyFactory(FactoryBuilder.factoryOf(expiryPolicyClient));
  Cache<Integer,Integer> cache=getCacheManager().createCache(getTestCacheName(),config);
  final Integer key=123;
  final Integer setValue=456;
  final Integer modifySetValue=789;
  EntryProcessor processors[]=new EntryProcessor[]{new AssertNotPresentEntryProcessor(null),new SetEntryProcessor<Integer,Integer>(111),new SetEntryProcessor<Integer,Integer>(setValue),new GetEntryProcessor<Integer,Integer>()};
  Object[] result=(Object[])cache.invoke(key,new CombineEntryProcessor(processors));
  assertEquals(result[1],111);
  assertEquals(result[2],setValue);
  assertEquals(result[3],setValue);
  assertThat(expiryPolicy.getCreationCount(),greaterThanOrEqualTo(1));
  assertThat(expiryPolicy.getAccessCount(),greaterThanOrEqualTo(0));
  assertThat(expiryPolicy.getUpdatedCount(),greaterThanOrEqualTo(0));
}
Program: 19322
Project: 19322
Buggy source:
@Test public void invokeSetValueShouldCallGetExpiry(){
  CountingExpiryPolicy expiryPolicy=new CountingExpiryPolicy();
  expiryPolicyServer.setExpiryPolicy(expiryPolicy);
  MutableConfiguration<Integer,Integer> config=new MutableConfiguration<>();
  config.setExpiryPolicyFactory(FactoryBuilder.factoryOf(expiryPolicyClient));
  Cache<Integer,Integer> cache=getCacheManager().createCache(getTestCacheName(),config);
  final Integer key=123;
  final Integer setValue=456;
  final Integer modifySetValue=789;
  EntryProcessor processors[]=new EntryProcessor[]{new AssertNotPresentEntryProcessor(null),new SetEntryProcessor<Integer,Integer,Integer>(setValue),new GetEntryProcessor<Integer,Integer,Integer>()};
  Object[] result=(Object[])cache.invoke(key,new CombineEntryProcessor(processors));
  assertEquals(result[1],setValue);
  assertEquals(result[2],setValue);
  assertThat(expiryPolicy.getCreationCount(),greaterThanOrEqualTo(1));
  assertThat(expiryPolicy.getAccessCount(),is(0));
  assertThat(expiryPolicy.getUpdatedCount(),is(0));
  expiryPolicy.resetCount();
  Integer resultValue=cache.invoke(key,new SetEntryProcessor<Integer,Integer,Integer>(modifySetValue));
  assertEquals(modifySetValue,resultValue);
  assertThat(expiryPolicy.getCreationCount(),is(0));
  assertThat(expiryPolicy.getAccessCount(),is(0));
  assertThat(expiryPolicy.getUpdatedCount(),greaterThanOrEqualTo(1));
}

Fixed version (ground truth):
@Test public void invokeSetValueShouldCallGetExpiry(){
  CountingExpiryPolicy expiryPolicy=new CountingExpiryPolicy();
  expiryPolicyServer.setExpiryPolicy(expiryPolicy);
  MutableConfiguration<Integer,Integer> config=new MutableConfiguration<>();
  config.setExpiryPolicyFactory(FactoryBuilder.factoryOf(expiryPolicyClient));
  Cache<Integer,Integer> cache=getCacheManager().createCache(getTestCacheName(),config);
  final Integer key=123;
  final Integer setValue=456;
  final Integer modifySetValue=789;
  EntryProcessor processors[]=new EntryProcessor[]{new AssertNotPresentEntryProcessor(null),new SetEntryProcessor<Integer,Integer>(setValue),new GetEntryProcessor<Integer,Integer>()};
  Object[] result=(Object[])cache.invoke(key,new CombineEntryProcessor(processors));
  assertEquals(result[1],setValue);
  assertEquals(result[2],setValue);
  assertThat(expiryPolicy.getCreationCount(),greaterThanOrEqualTo(1));
  assertThat(expiryPolicy.getAccessCount(),is(0));
  assertThat(expiryPolicy.getUpdatedCount(),is(0));
  expiryPolicy.resetCount();
  Integer resultValue=cache.invoke(key,new SetEntryProcessor<Integer,Integer>(modifySetValue));
  assertEquals(modifySetValue,resultValue);
  assertThat(expiryPolicy.getCreationCount(),is(0));
  assertThat(expiryPolicy.getAccessCount(),is(0));
  assertThat(expiryPolicy.getUpdatedCount(),greaterThanOrEqualTo(1));
}
Program: 19324
Project: 19324
Buggy source:
@Test public void invokeAllReadThroughEnabledGetOnNonExistentEntry() throws IOException {
  RecordingCacheLoader<Integer> recordingCacheLoader=new RecordingCacheLoader<>();
  try (CacheLoaderServer<Integer,Integer> cacheLoaderServer=new CacheLoaderServer<>(10000,recordingCacheLoader)){
    cacheLoaderServer.open();
    CacheLoaderClient<Integer,Integer> cacheLoader=new CacheLoaderClient<>(cacheLoaderServer.getInetAddress(),cacheLoaderServer.getPort());
    CountingExpiryPolicy expiryPolicy=new CountingExpiryPolicy();
    expiryPolicyServer.setExpiryPolicy(expiryPolicy);
    MutableConfiguration<Integer,Integer> config=new MutableConfiguration<>();
    config.setExpiryPolicyFactory(FactoryBuilder.factoryOf(expiryPolicyClient));
    config.setCacheLoaderFactory(FactoryBuilder.factoryOf(cacheLoader));
    config.setReadThrough(true);
    Cache<Integer,Integer> cache=getCacheManager().createCache(getTestCacheName(),config);
    final Integer INITIAL_KEY=123;
    final Integer MAX_KEY_VALUE=INITIAL_KEY + 4;
    Set<Integer> keys=new HashSet<>();
    for (int key=INITIAL_KEY; key <= MAX_KEY_VALUE; key++) {
      keys.add(key);
    }
    Map<Integer,Integer> resultMap=cache.invokeAll(keys,new GetEntryProcessor<Integer,Integer,Integer>());
    assertThat(expiryPolicy.getCreationCount(),greaterThanOrEqualTo(keys.size()));
    assertThat(expiryPolicy.getAccessCount(),is(0));
    assertThat(expiryPolicy.getUpdatedCount(),is(0));
    expiryPolicy.resetCount();
  }
 }

Fixed version (ground truth):
@Test public void invokeAllReadThroughEnabledGetOnNonExistentEntry() throws IOException {
  RecordingCacheLoader<Integer> recordingCacheLoader=new RecordingCacheLoader<>();
  try (CacheLoaderServer<Integer,Integer> cacheLoaderServer=new CacheLoaderServer<>(10000,recordingCacheLoader)){
    cacheLoaderServer.open();
    CacheLoaderClient<Integer,Integer> cacheLoader=new CacheLoaderClient<>(cacheLoaderServer.getInetAddress(),cacheLoaderServer.getPort());
    CountingExpiryPolicy expiryPolicy=new CountingExpiryPolicy();
    expiryPolicyServer.setExpiryPolicy(expiryPolicy);
    MutableConfiguration<Integer,Integer> config=new MutableConfiguration<>();
    config.setExpiryPolicyFactory(FactoryBuilder.factoryOf(expiryPolicyClient));
    config.setCacheLoaderFactory(FactoryBuilder.factoryOf(cacheLoader));
    config.setReadThrough(true);
    Cache<Integer,Integer> cache=getCacheManager().createCache(getTestCacheName(),config);
    final Integer INITIAL_KEY=123;
    final Integer MAX_KEY_VALUE=INITIAL_KEY + 4;
    Set<Integer> keys=new HashSet<>();
    for (int key=INITIAL_KEY; key <= MAX_KEY_VALUE; key++) {
      keys.add(key);
    }
    Map<Integer,Integer> resultMap=cache.invokeAll(keys,new GetEntryProcessor<Integer,Integer>());
    assertThat(expiryPolicy.getCreationCount(),greaterThanOrEqualTo(keys.size()));
    assertThat(expiryPolicy.getAccessCount(),is(0));
    assertThat(expiryPolicy.getUpdatedCount(),is(0));
    expiryPolicy.resetCount();
  }
 }
Program: 19325
Project: 19325
Buggy source:
@Test public void invokeGetValueWithReadThroughForNonExistentEntryShouldCallGetExpiryForCreatedEntry() throws IOException {
  RecordingCacheLoader<Integer> recordingCacheLoader=new RecordingCacheLoader<>();
  try (CacheLoaderServer<Integer,Integer> cacheLoaderServer=new CacheLoaderServer<>(10000,recordingCacheLoader)){
    cacheLoaderServer.open();
    CacheLoaderClient<Integer,Integer> cacheLoader=new CacheLoaderClient<>(cacheLoaderServer.getInetAddress(),cacheLoaderServer.getPort());
    CountingExpiryPolicy expiryPolicy=new CountingExpiryPolicy();
    expiryPolicyServer.setExpiryPolicy(expiryPolicy);
    MutableConfiguration<Integer,Integer> config=new MutableConfiguration<>();
    config.setExpiryPolicyFactory(FactoryBuilder.factoryOf(expiryPolicyClient));
    config.setCacheLoaderFactory(FactoryBuilder.factoryOf(cacheLoader));
    config.setReadThrough(true);
    Cache<Integer,Integer> cache=getCacheManager().createCache(getTestCacheName(),config);
    final Integer key=123;
    final Integer recordingCacheLoaderValue=key;
    Integer resultValue=cache.invoke(key,new GetEntryProcessor<Integer,Integer,Integer>());
    assertEquals(recordingCacheLoaderValue,resultValue);
    assertTrue(recordingCacheLoader.hasLoaded(key));
    assertThat(expiryPolicy.getCreationCount(),greaterThanOrEqualTo(1));
    assertThat(expiryPolicy.getAccessCount(),is(0));
    assertThat(expiryPolicy.getUpdatedCount(),is(0));
  }
 }

Fixed version (ground truth):
@Test public void invokeGetValueWithReadThroughForNonExistentEntryShouldCallGetExpiryForCreatedEntry() throws IOException {
  RecordingCacheLoader<Integer> recordingCacheLoader=new RecordingCacheLoader<>();
  try (CacheLoaderServer<Integer,Integer> cacheLoaderServer=new CacheLoaderServer<>(10000,recordingCacheLoader)){
    cacheLoaderServer.open();
    CacheLoaderClient<Integer,Integer> cacheLoader=new CacheLoaderClient<>(cacheLoaderServer.getInetAddress(),cacheLoaderServer.getPort());
    CountingExpiryPolicy expiryPolicy=new CountingExpiryPolicy();
    expiryPolicyServer.setExpiryPolicy(expiryPolicy);
    MutableConfiguration<Integer,Integer> config=new MutableConfiguration<>();
    config.setExpiryPolicyFactory(FactoryBuilder.factoryOf(expiryPolicyClient));
    config.setCacheLoaderFactory(FactoryBuilder.factoryOf(cacheLoader));
    config.setReadThrough(true);
    Cache<Integer,Integer> cache=getCacheManager().createCache(getTestCacheName(),config);
    final Integer key=123;
    final Integer recordingCacheLoaderValue=key;
    Integer resultValue=cache.invoke(key,new GetEntryProcessor<Integer,Integer>());
    assertEquals(recordingCacheLoaderValue,resultValue);
    assertTrue(recordingCacheLoader.hasLoaded(key));
    assertThat(expiryPolicy.getCreationCount(),greaterThanOrEqualTo(1));
    assertThat(expiryPolicy.getAccessCount(),is(0));
    assertThat(expiryPolicy.getUpdatedCount(),is(0));
  }
 }
Program: 19326
Project: 19326
Buggy source:
@Override public Cache.Entry<K,V> load(final K key){
  final V value=getClient().invoke(new LoadOperation<K,V>(key));
  return value == null ? null : new Cache.Entry<K,V>(){
    @Override public K getKey(){
      return key;
    }
    @Override public V getValue(){
      return value;
    }
    @Override public <T>T unwrap(    Class<T> clazz){
      throw new UnsupportedOperationException("String_Node_Str");
    }
  }
;
}

Fixed version (ground truth):
@Override public V load(final K key){
  return getClient().invoke(new LoadOperation<K,V>(key));
}
Program: 19327
Project: 19327
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void onProcess(ObjectInputStream ois,ObjectOutputStream oos) throws IOException, ClassNotFoundException {
  if (cacheLoader == null) {
    throw new NullPointerException("String_Node_Str");
  }
 else {
    K key=(K)ois.readObject();
    Cache.Entry<K,V> entry=null;
    try {
      entry=cacheLoader.load(key);
    }
 catch (    Exception e) {
      oos.writeObject(e);
    }
    if (entry == null) {
      oos.writeObject(null);
    }
 else {
      oos.writeObject(entry.getValue());
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void onProcess(ObjectInputStream ois,ObjectOutputStream oos) throws IOException, ClassNotFoundException {
  if (cacheLoader == null) {
    throw new NullPointerException("String_Node_Str");
  }
 else {
    K key=(K)ois.readObject();
    V value=null;
    try {
      value=cacheLoader.load(key);
      oos.writeObject(value);
    }
 catch (    Exception e) {
      oos.writeObject(e);
    }
  }
}
Program: 19328
Project: 19328
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Cache.Entry load(Object key){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public V load(Object key){
  throw new UnsupportedOperationException();
}
Program: 19329
Project: 19329
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Cache.Entry<K,V> load(final K key){
  return new Cache.Entry<K,V>(){
    @Override public K getKey(){
      return key;
    }
    @Override public V getValue(){
      return null;
    }
    @Override public <T>T unwrap(    Class<T> clazz){
      throw new UnsupportedOperationException("String_Node_Str");
    }
  }
;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public V load(K key){
  return null;
}
Program: 19330
Project: 19330
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Cache.Entry<K,K> load(final K key){
  if (key == null) {
    throw new NullPointerException("String_Node_Str");
  }
 else {
    loaded.put(key,key);
    loadCount.incrementAndGet();
    return new Cache.Entry<K,K>(){
      @Override public K getKey(){
        return key;
      }
      @Override public K getValue(){
        return key;
      }
      @Override public <T>T unwrap(      Class<T> clazz){
        throw new UnsupportedOperationException();
      }
    }
;
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public K load(final K key){
  if (key == null) {
    throw new NullPointerException("String_Node_Str");
  }
 else {
    loaded.put(key,key);
    loadCount.incrementAndGet();
    return key;
  }
}
Program: 19331
Project: 19331
Buggy source:
/** 
 * Ensure that values can be loaded from the   {@link CacheLoaderClient} viathe  {@link CacheLoaderServer}.
 */
@Test public void shouldLoadFromServerWithClient(){
  RecordingCacheLoader<String> recordingCacheLoader=new RecordingCacheLoader<String>();
  CacheLoaderServer<String,String> serverCacheLoader=new CacheLoaderServer<String,String>(10000,recordingCacheLoader);
  try {
    serverCacheLoader.open();
    CacheLoaderClient<String,String> clientCacheLoader=new CacheLoaderClient<>(serverCacheLoader.getInetAddress(),10000);
    Cache.Entry<String,String> entry=clientCacheLoader.load("String_Node_Str");
    Assert.assertThat(entry,is(notNullValue()));
    Assert.assertThat(entry.getValue(),is("String_Node_Str"));
    Assert.assertThat(recordingCacheLoader.hasLoaded("String_Node_Str"),is(true));
  }
 catch (  Exception e) {
  }
 finally {
    serverCacheLoader.close();
  }
}

Fixed version (ground truth):
/** 
 * Ensure that values can be loaded from the   {@link CacheLoaderClient} viathe  {@link CacheLoaderServer}.
 */
@Test public void shouldLoadFromServerWithClient(){
  RecordingCacheLoader<String> recordingCacheLoader=new RecordingCacheLoader<String>();
  CacheLoaderServer<String,String> serverCacheLoader=new CacheLoaderServer<String,String>(10000,recordingCacheLoader);
  try {
    serverCacheLoader.open();
    CacheLoaderClient<String,String> clientCacheLoader=new CacheLoaderClient<>(serverCacheLoader.getInetAddress(),10000);
    String value=clientCacheLoader.load("String_Node_Str");
    Assert.assertThat(value,is(notNullValue()));
    Assert.assertThat(value,is("String_Node_Str"));
    Assert.assertThat(recordingCacheLoader.hasLoaded("String_Node_Str"),is(true));
  }
 catch (  Exception e) {
  }
 finally {
    serverCacheLoader.close();
  }
}
Program: 19332
Project: 19332
Buggy source:
/** 
 * Ensure that exceptions thrown by an underlying cache loader are re-thrown.
 */
@Test public void shouldRethrowExceptions(){
  FailingCacheLoader<String,String> failingCacheLoader=new FailingCacheLoader<>();
  CacheLoaderServer<String,String> serverCacheLoader=new CacheLoaderServer<String,String>(10000,failingCacheLoader);
  try {
    serverCacheLoader.open();
    CacheLoaderClient<String,String> clientCacheLoader=new CacheLoaderClient<>(serverCacheLoader.getInetAddress(),10000);
    Cache.Entry<String,String> entry=clientCacheLoader.load("String_Node_Str");
    fail("String_Node_Str");
  }
 catch (  Exception e) {
  }
 finally {
    serverCacheLoader.close();
  }
}

Fixed version (ground truth):
/** 
 * Ensure that exceptions thrown by an underlying cache loader are re-thrown.
 */
@Test public void shouldRethrowExceptions(){
  FailingCacheLoader<String,String> failingCacheLoader=new FailingCacheLoader<>();
  CacheLoaderServer<String,String> serverCacheLoader=new CacheLoaderServer<String,String>(10000,failingCacheLoader);
  try {
    serverCacheLoader.open();
    CacheLoaderClient<String,String> clientCacheLoader=new CacheLoaderClient<>(serverCacheLoader.getInetAddress(),10000);
    String value=clientCacheLoader.load("String_Node_Str");
    fail("String_Node_Str");
  }
 catch (  Exception e) {
  }
 finally {
    serverCacheLoader.close();
  }
}
Program: 19333
Project: 19333
Buggy source:
/** 
 * Ensure that   {@link Cache#loadAll(java.util.Set,boolean,javax.cache.integration.CompletionListener)}won't load <code>null</code> entries.
 */
@Test public void shouldNotLoadMultipleNullEntriesUsingLoadAll() throws Exception {
  NullEntryCacheLoader<String,String> cacheLoader=new NullEntryCacheLoader<>();
  cacheLoaderServer.setCacheLoader(cacheLoader);
  HashSet<String> keys=new HashSet<>();
  keys.add("String_Node_Str");
  keys.add("String_Node_Str");
  keys.add("String_Node_Str");
  keys.add("String_Node_Str");
  CompletionListenerFuture future=new CompletionListenerFuture();
  cache.loadAll(keys,false,future);
  future.get();
  assertThat(future.isDone(),is(true));
  for (  String key : keys) {
    assertThat(cache.containsKey(key),is(false));
  }
}

Fixed version (ground truth):
/** 
 * Ensure that   {@link Cache#loadAll(java.util.Set,boolean,javax.cache.integration.CompletionListener)}won't load <code>null</code> entries.
 */
@Test public void shouldNotLoadMultipleNullEntriesUsingLoadAll() throws Exception {
  NullValueCacheLoader<String,String> cacheLoader=new NullValueCacheLoader<>();
  cacheLoaderServer.setCacheLoader(cacheLoader);
  HashSet<String> keys=new HashSet<>();
  keys.add("String_Node_Str");
  keys.add("String_Node_Str");
  keys.add("String_Node_Str");
  keys.add("String_Node_Str");
  CompletionListenerFuture future=new CompletionListenerFuture();
  cache.loadAll(keys,false,future);
  future.get();
  assertThat(future.isDone(),is(true));
  for (  String key : keys) {
    assertThat(cache.containsKey(key),is(false));
  }
}
Program: 19334
Project: 19334
Buggy source:
/** 
 * Ensure that a   {@link CacheLoader} that returns <code>null</code> entriesaren't placed in the cache.
 */
@Test public void shouldNotLoadNullEntries(){
  NullEntryCacheLoader<String,String> nullCacheLoader=new NullEntryCacheLoader<>();
  cacheLoaderServer.setCacheLoader(nullCacheLoader);
  HashSet<String> keys=new HashSet<String>();
  keys.add("String_Node_Str");
  keys.add("String_Node_Str");
  keys.add("String_Node_Str");
  keys.add("String_Node_Str");
  Map<String,String> map=cache.getAll(keys);
  assertThat(map.size(),is(0));
}

Fixed version (ground truth):
/** 
 * Ensure that a   {@link CacheLoader} that returns <code>null</code> entriesaren't placed in the cache.
 */
@Test public void shouldNotLoadNullEntries(){
  NullValueCacheLoader<String,String> nullCacheLoader=new NullValueCacheLoader<>();
  cacheLoaderServer.setCacheLoader(nullCacheLoader);
  HashSet<String> keys=new HashSet<String>();
  keys.add("String_Node_Str");
  keys.add("String_Node_Str");
  keys.add("String_Node_Str");
  keys.add("String_Node_Str");
  Map<String,String> map=cache.getAll(keys);
  assertThat(map.size(),is(0));
}
Program: 19335
Project: 19335
Buggy source:
@Test public void shouldWriteThroughRemoveAll(){
  assertEquals(0,cacheWriter.getWriteCount());
  assertEquals(0,cacheWriter.getDeleteCount());
  HashMap<Integer,String> map=new HashMap<>();
  map.put(1,"String_Node_Str");
  map.put(2,"String_Node_Str");
  map.put(3,"String_Node_Str");
  cache.putAll(map);
  assertEquals(3,cacheWriter.getWriteCount());
  assertEquals(0,cacheWriter.getDeleteCount());
  for (  Integer key : map.keySet()) {
    assertTrue(cacheWriter.hasWritten(key));
    assertEquals(map.get(key),cacheWriter.get(key));
    assertTrue(cache.containsKey(key));
    assertEquals(map.get(key),cache.get(key));
  }
  cache.removeAll();
  assertEquals(3,cacheWriter.getWriteCount());
  assertEquals(3,cacheWriter.getDeleteCount());
  for (  Integer key : map.keySet()) {
    assertFalse(cacheWriter.hasWritten(key));
    assertFalse(cache.containsKey(key));
  }
  map.put(4,"String_Node_Str");
  cache.putAll(map);
  assertEquals(7,cacheWriter.getWriteCount());
  assertEquals(3,cacheWriter.getDeleteCount());
  for (  Integer key : map.keySet()) {
    assertTrue(cacheWriter.hasWritten(key));
    assertEquals(map.get(key),cacheWriter.get(key));
    assertTrue(cache.containsKey(key));
    assertEquals(map.get(key),cache.get(key));
  }
}

Fixed version (ground truth):
@Test public void shouldWriteThroughRemoveAll(){
  assertEquals(0,cacheWriter.getWriteCount());
  assertEquals(0,cacheWriter.getDeleteCount());
  HashMap<Integer,String> map=new HashMap<>();
  map.put(1,"String_Node_Str");
  map.put(2,"String_Node_Str");
  map.put(3,"String_Node_Str");
  cache.putAll(map);
  assertEquals(3,cacheWriter.getWriteCount());
  assertEquals(0,cacheWriter.getDeleteCount());
  for (  Integer key : map.keySet()) {
    assertTrue(cacheWriter.hasWritten(key));
    assertEquals(map.get(key),cacheWriter.get(key));
    assertTrue(cache.containsKey(key));
    assertEquals(map.get(key),cache.get(key));
  }
  cache.removeAll();
  assertEquals(3,cacheWriter.getWriteCount());
  assertEquals(3,cacheWriter.getDeleteCount());
  for (  Integer key : map.keySet()) {
    assertFalse(cacheWriter.hasWritten(key));
    assertFalse(cache.containsKey(key));
  }
  cache.removeAll();
  assertEquals(3,cacheWriter.getWriteCount());
  assertEquals(3,cacheWriter.getDeleteCount());
  for (  Integer key : map.keySet()) {
    assertFalse(cacheWriter.hasWritten(key));
    assertFalse(cache.containsKey(key));
  }
  map.put(4,"String_Node_Str");
  cache.putAll(map);
  assertEquals(7,cacheWriter.getWriteCount());
  assertEquals(3,cacheWriter.getDeleteCount());
  for (  Integer key : map.keySet()) {
    assertTrue(cacheWriter.hasWritten(key));
    assertEquals(map.get(key),cacheWriter.get(key));
    assertTrue(cache.containsKey(key));
    assertEquals(map.get(key),cache.get(key));
  }
}
Program: 19336
Project: 19336
Buggy source:
/** 
 * Ensure that multiple   {@link MutableConfiguration}s are equal but not the same.
 */
@Test public void shouldNotBeTheSame(){
  Configuration<?,?> config1=new MutableConfiguration<>();
  Configuration<?,?> config2=new MutableConfiguration<>();
  assertNotSame(config1,config2);
}

Fixed version (ground truth):
/** 
 * Ensure that multiple   {@link MutableConfiguration}s are equal but not the same.
 */
@Test public void shouldNotBeTheSame(){
  Configuration config1=new MutableConfiguration();
  Configuration config2=new MutableConfiguration();
  assertNotSame(config1,config2);
}
Program: 19337
Project: 19337
Buggy source:
/** 
 * Ensure that two   {@link MutableConfiguration}s are equal.
 */
@Test public void shouldBeEqualWhenUsingDefaults(){
  Configuration<?,?> config1=new MutableConfiguration<>();
  Configuration<?,?> config2=new MutableConfiguration<>();
  assertEquals(config1,config2);
}

Fixed version (ground truth):
/** 
 * Ensure that two   {@link MutableConfiguration}s are equal.
 */
@Test public void shouldBeEqualWhenUsingDefaults(){
  Configuration config1=new MutableConfiguration();
  Configuration config2=new MutableConfiguration();
  assertEquals(config1,config2);
}
Program: 19338
Project: 19338
Buggy source:
/** 
 * Ensure that a   {@link MutableConfiguration} correctly uses the defaults.
 */
@Test public void shouldUseDefaults(){
  Configuration<?,?> config=new MutableConfiguration<>();
  assertFalse(config.isReadThrough());
  assertFalse(config.isWriteThrough());
  assertFalse(config.isStatisticsEnabled());
  assertTrue(config.isStoreByValue());
  ExpiryPolicy<?,?> expiryPolicy=config.getExpiryPolicyFactory().create();
  Duration duration=new Duration(TimeUnit.MINUTES,10);
  assertThat(Duration.ETERNAL,equalTo(expiryPolicy.getExpiryForCreatedEntry(null)));
  assertThat(expiryPolicy.getExpiryForAccessedEntry(null),is(nullValue()));
  assertThat(expiryPolicy.getExpiryForModifiedEntry(null),is(nullValue()));
}

Fixed version (ground truth):
/** 
 * Ensure that a   {@link MutableConfiguration} correctly uses the defaults.
 */
@Test public void shouldUseDefaults(){
  Configuration<?,?> config=new MutableConfiguration();
  assertFalse(config.isReadThrough());
  assertFalse(config.isWriteThrough());
  assertFalse(config.isStatisticsEnabled());
  assertTrue(config.isStoreByValue());
  ExpiryPolicy<?,?> expiryPolicy=config.getExpiryPolicyFactory().create();
  assertThat(Duration.ETERNAL,equalTo(expiryPolicy.getExpiryForCreatedEntry(null)));
  assertThat(expiryPolicy.getExpiryForAccessedEntry(null),is(nullValue()));
  assertThat(expiryPolicy.getExpiryForModifiedEntry(null),is(nullValue()));
}
Program: 19339
Project: 19339
Buggy source:
/** 
 * Ensure that multiple   {@link MutableConfiguration}s are equal but not the same, including those that are cloned.
 */
@Test public void shouldNotBeTheSameButAClone(){
  Configuration<?,?> config1=new MutableConfiguration<>(new MutableConfiguration<>());
  Configuration<?,?> config2=new MutableConfiguration<>();
  assertNotSame(config1,config2);
  assertEquals(config1,config2);
}

Fixed version (ground truth):
/** 
 * Ensure that multiple   {@link MutableConfiguration}s are equal but not the same, including those that are cloned.
 */
@Test public void shouldNotBeTheSameButAClone(){
  Configuration config1=new MutableConfiguration(new MutableConfiguration());
  Configuration config2=new MutableConfiguration();
  assertNotSame(config1,config2);
  assertEquals(config1,config2);
}
Program: 19340
Project: 19340
Buggy source:
/** 
 * Ensure that multiple   {@link MutableConfiguration}s are equal.
 */
@Test public void shouldEqual(){
  Configuration<?,?> config1=new MutableConfiguration<>();
  Configuration<?,?> config2=new MutableConfiguration<>();
  assertEquals(config1,config2);
}

Fixed version (ground truth):
/** 
 * Ensure that multiple   {@link MutableConfiguration}s are equal.
 */
@Test public void shouldEqual(){
  Configuration config1=new MutableConfiguration();
  Configuration config2=new MutableConfiguration();
  assertEquals(config1,config2);
}
Program: 19341
Project: 19341
Buggy source:
@Test public void getUntypedCache(){
  CacheManager cacheManager=getCacheManager();
  MutableConfiguration config=new MutableConfiguration();
  cacheManager.createCache("String_Node_Str",config);
  Cache cache=cacheManager.getCache("String_Node_Str");
  assertNotNull(cache);
  assertNull(cache.getConfiguration().getKeyType());
  assertNull(cache.getConfiguration().getValueType());
}

Fixed version (ground truth):
@Test public void getUntypedCache(){
  CacheManager cacheManager=getCacheManager();
  MutableConfiguration config=new MutableConfiguration();
  cacheManager.createCache("String_Node_Str",config);
  Cache cache=cacheManager.getCache("String_Node_Str");
  assertNotNull(cache);
  assertEquals(Object.class,cache.getConfiguration().getKeyType());
  assertEquals(Object.class,cache.getConfiguration().getValueType());
}
Program: 19342
Project: 19342
Buggy source:
@Test public void nullKey(){
  try {
    cache.invokeEntryProcessor((Integer)null,new MockEntryProcessor<Integer,String,Void>());
    fail("String_Node_Str");
  }
 catch (  NullPointerException e) {
  }
}

Fixed version (ground truth):
@Test public void nullKey(){
  try {
    cache.invoke(null,new MockEntryProcessor<Integer,String,Void>());
    fail("String_Node_Str");
  }
 catch (  NullPointerException e) {
  }
}
Program: 19343
Project: 19343
Buggy source:
@Test public void removeThere(){
  final Integer key=123;
  final String oldValue="String_Node_Str";
  Cache.EntryProcessor<Integer,String,String> processor=new RemoveThereEntryProcessor<Integer,String,String>();
  cache.put(key,oldValue);
  assertEquals(oldValue,cache.invokeEntryProcessor(key,processor));
  assertFalse(cache.containsKey(key));
}

Fixed version (ground truth):
@Test public void removeThere(){
  final Integer key=123;
  final String oldValue="String_Node_Str";
  Cache.EntryProcessor<Integer,String,String> processor=new RemoveThereEntryProcessor<Integer,String,String>();
  cache.put(key,oldValue);
  assertEquals(oldValue,cache.invoke(key,processor));
  assertFalse(cache.containsKey(key));
}