nus-yam/ex-repair huggingface dataset:
Program: 48291
Project: 48291
Buggy source:
protected Data putInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  PutOperation operation=new PutOperation(name,key,value,getTimeInMillis(ttl,timeunit));
  Data previousValue=(Data)invokeOperation(key,operation);
  invalidateLocalNearCache(key);
  return previousValue;
}

Fixed version (ground truth):
protected Data putInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  PutOperation operation=new PutOperation(name,key,value,getTimeInMillis(ttl,timeunit));
  Data previousValue=(Data)invokeOperation(key,operation);
  invalidateNearCache(key);
  return previousValue;
}
Program: 48292
Project: 48292
Buggy source:
protected boolean removeInternal(final Data key,final Data value){
  RemoveIfSameOperation operation=new RemoveIfSameOperation(name,key,value);
  boolean removed=(Boolean)invokeOperation(key,operation);
  invalidateLocalNearCache(key);
  return removed;
}

Fixed version (ground truth):
protected boolean removeInternal(final Data key,final Data value){
  RemoveIfSameOperation operation=new RemoveIfSameOperation(name,key,value);
  boolean removed=(Boolean)invokeOperation(key,operation);
  invalidateNearCache(key);
  return removed;
}
Program: 48293
Project: 48293
Buggy source:
protected ICompletableFuture<Data> removeAsyncInternal(final Data key){
  final NodeEngine nodeEngine=getNodeEngine();
  int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
  RemoveOperation operation=new RemoveOperation(name,key);
  operation.setThreadId(ThreadUtil.getThreadId());
  try {
    ICompletableFuture<Data> future=nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME,operation,partitionId);
    invalidateLocalNearCache(key);
    return future;
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}

Fixed version (ground truth):
protected ICompletableFuture<Data> removeAsyncInternal(final Data key){
  final NodeEngine nodeEngine=getNodeEngine();
  int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
  RemoveOperation operation=new RemoveOperation(name,key);
  operation.setThreadId(ThreadUtil.getThreadId());
  try {
    ICompletableFuture<Data> future=nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME,operation,partitionId);
    invalidateNearCache(key);
    return future;
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}
Program: 48294
Project: 48294
Buggy source:
protected boolean tryRemoveInternal(final Data key,final long timeout,final TimeUnit timeunit){
  TryRemoveOperation operation=new TryRemoveOperation(name,key,getTimeInMillis(timeout,timeunit));
  boolean removed=(Boolean)invokeOperation(key,operation);
  invalidateLocalNearCache(key);
  return removed;
}

Fixed version (ground truth):
protected boolean tryRemoveInternal(final Data key,final long timeout,final TimeUnit timeunit){
  TryRemoveOperation operation=new TryRemoveOperation(name,key,getTimeInMillis(timeout,timeunit));
  boolean removed=(Boolean)invokeOperation(key,operation);
  invalidateNearCache(key);
  return removed;
}
Program: 48295
Project: 48295
Buggy source:
/** 
 * {@link IMap#executeOnEntries(EntryProcessor,Predicate)}
 */
public Map executeOnEntries(EntryProcessor entryProcessor,Predicate predicate){
  Map result=new HashMap();
  try {
    NodeEngine nodeEngine=getNodeEngine();
    Map<Integer,Object> results=nodeEngine.getOperationService().invokeOnAllPartitions(SERVICE_NAME,new PartitionWideEntryWithPredicateOperationFactory(name,entryProcessor,predicate));
    for (    Object o : results.values()) {
      if (o != null) {
        final MapService service=getService();
        final MapEntrySet mapEntrySet=(MapEntrySet)o;
        for (        Entry<Data,Data> entry : mapEntrySet.getEntrySet()) {
          final Data key=entry.getKey();
          result.put(service.toObject(key),service.toObject(entry.getValue()));
          invalidateLocalNearCache(key);
        }
      }
    }
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * {@link IMap#executeOnEntries(EntryProcessor,Predicate)}
 */
public Map executeOnEntries(EntryProcessor entryProcessor,Predicate predicate){
  Map result=new HashMap();
  try {
    NodeEngine nodeEngine=getNodeEngine();
    Map<Integer,Object> results=nodeEngine.getOperationService().invokeOnAllPartitions(SERVICE_NAME,new PartitionWideEntryWithPredicateOperationFactory(name,entryProcessor,predicate));
    for (    Object o : results.values()) {
      if (o != null) {
        final MapService service=getService();
        final MapEntrySet mapEntrySet=(MapEntrySet)o;
        for (        Entry<Data,Data> entry : mapEntrySet.getEntrySet()) {
          final Data key=entry.getKey();
          result.put(service.toObject(key),service.toObject(entry.getValue()));
          invalidateNearCache(key);
        }
      }
    }
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
  return result;
}
Program: 48296
Project: 48296
Buggy source:
protected ICompletableFuture<Data> putAsyncInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  final NodeEngine nodeEngine=getNodeEngine();
  int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
  PutOperation operation=new PutOperation(name,key,value,getTimeInMillis(ttl,timeunit));
  operation.setThreadId(ThreadUtil.getThreadId());
  try {
    ICompletableFuture<Data> future=nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME,operation,partitionId);
    invalidateLocalNearCache(key);
    return future;
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}

Fixed version (ground truth):
protected ICompletableFuture<Data> putAsyncInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  final NodeEngine nodeEngine=getNodeEngine();
  int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
  PutOperation operation=new PutOperation(name,key,value,getTimeInMillis(ttl,timeunit));
  operation.setThreadId(ThreadUtil.getThreadId());
  try {
    ICompletableFuture<Data> future=nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME,operation,partitionId);
    invalidateNearCache(key);
    return future;
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}
Program: 48297
Project: 48297
Buggy source:
protected void deleteInternal(Data key){
  RemoveOperation operation=new RemoveOperation(name,key);
  invokeOperation(key,operation);
  invalidateLocalNearCache(key);
}

Fixed version (ground truth):
protected void deleteInternal(Data key){
  RemoveOperation operation=new RemoveOperation(name,key);
  invokeOperation(key,operation);
  invalidateNearCache(key);
}
Program: 48298
Project: 48298
Buggy source:
protected void setInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  SetOperation operation=new SetOperation(name,key,value,timeunit.toMillis(ttl));
  invokeOperation(key,operation);
  invalidateLocalNearCache(key);
}

Fixed version (ground truth):
protected void setInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  SetOperation operation=new SetOperation(name,key,value,timeunit.toMillis(ttl));
  invokeOperation(key,operation);
  invalidateNearCache(key);
}
Program: 48300
Project: 48300
Buggy source:
public Map executeOnKeysInternal(Set<Data> keys,EntryProcessor entryProcessor){
  Map result=new HashMap();
  final NodeEngine nodeEngine=getNodeEngine();
  final Collection<Integer> partitionsForKeys=getPartitionsForKeys(keys);
  try {
    MultipleEntryOperationFactory operationFactory=new MultipleEntryOperationFactory(name,keys,entryProcessor);
    Map<Integer,Object> results=nodeEngine.getOperationService().invokeOnPartitions(SERVICE_NAME,operationFactory,partitionsForKeys);
    for (    Object o : results.values()) {
      if (o != null) {
        final MapService service=getService();
        final MapEntrySet mapEntrySet=(MapEntrySet)o;
        for (        Entry<Data,Data> entry : mapEntrySet.getEntrySet()) {
          result.put(service.toObject(entry.getKey()),service.toObject(entry.getValue()));
        }
      }
    }
    invalidateLocalNearCache(keys);
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
  return result;
}

Fixed version (ground truth):
public Map executeOnKeysInternal(Set<Data> keys,EntryProcessor entryProcessor){
  Map result=new HashMap();
  final NodeEngine nodeEngine=getNodeEngine();
  final Collection<Integer> partitionsForKeys=getPartitionsForKeys(keys);
  try {
    MultipleEntryOperationFactory operationFactory=new MultipleEntryOperationFactory(name,keys,entryProcessor);
    Map<Integer,Object> results=nodeEngine.getOperationService().invokeOnPartitions(SERVICE_NAME,operationFactory,partitionsForKeys);
    for (    Object o : results.values()) {
      if (o != null) {
        final MapService service=getService();
        final MapEntrySet mapEntrySet=(MapEntrySet)o;
        for (        Entry<Data,Data> entry : mapEntrySet.getEntrySet()) {
          result.put(service.toObject(entry.getKey()),service.toObject(entry.getValue()));
        }
      }
    }
    invalidateNearCache(keys);
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
  return result;
}
Program: 48301
Project: 48301
Buggy source:
protected Data putIfAbsentInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  PutIfAbsentOperation operation=new PutIfAbsentOperation(name,key,value,getTimeInMillis(ttl,timeunit));
  Data previousValue=(Data)invokeOperation(key,operation);
  invalidateLocalNearCache(key);
  return previousValue;
}

Fixed version (ground truth):
protected Data putIfAbsentInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  PutIfAbsentOperation operation=new PutIfAbsentOperation(name,key,value,getTimeInMillis(ttl,timeunit));
  Data previousValue=(Data)invokeOperation(key,operation);
  invalidateNearCache(key);
  return previousValue;
}
Program: 48302
Project: 48302
Buggy source:
protected void putTransientInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  PutTransientOperation operation=new PutTransientOperation(name,key,value,getTimeInMillis(ttl,timeunit));
  invokeOperation(key,operation);
  invalidateLocalNearCache(key);
}

Fixed version (ground truth):
protected void putTransientInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  PutTransientOperation operation=new PutTransientOperation(name,key,value,getTimeInMillis(ttl,timeunit));
  invokeOperation(key,operation);
  invalidateNearCache(key);
}
Program: 48303
Project: 48303
Buggy source:
protected Data replaceInternal(final Data key,final Data value){
  ReplaceOperation operation=new ReplaceOperation(name,key,value);
  final Data result=(Data)invokeOperation(key,operation);
  invalidateLocalNearCache(key);
  return result;
}

Fixed version (ground truth):
protected Data replaceInternal(final Data key,final Data value){
  ReplaceOperation operation=new ReplaceOperation(name,key,value);
  final Data result=(Data)invokeOperation(key,operation);
  invalidateNearCache(key);
  return result;
}
Program: 48304
Project: 48304
Buggy source:
NearCache getNearCache(String mapName){
  return ConcurrencyUtil.getOrPutIfAbsent(nearCacheMap,mapName,nearCacheConstructor);
}

Fixed version (ground truth):
public NearCache getNearCache(String mapName){
  return ConcurrencyUtil.getOrPutIfAbsent(nearCacheMap,mapName,nearCacheConstructor);
}
Program: 48305
Project: 48305
Buggy source:
protected boolean evictInternal(final Data key){
  EvictOperation operation=new EvictOperation(name,key,false);
  final boolean evictSuccess=(Boolean)invokeOperation(key,operation);
  invalidateLocalNearCache(key);
  return evictSuccess;
}

Fixed version (ground truth):
protected boolean evictInternal(final Data key){
  EvictOperation operation=new EvictOperation(name,key,false);
  final boolean evictSuccess=(Boolean)invokeOperation(key,operation);
  invalidateNearCache(key);
  return evictSuccess;
}
Program: 48306
Project: 48306
Buggy source:
protected boolean tryPutInternal(final Data key,final Data value,final long timeout,final TimeUnit timeunit){
  TryPutOperation operation=new TryPutOperation(name,key,value,getTimeInMillis(timeout,timeunit));
  boolean putSuccessful=(Boolean)invokeOperation(key,operation);
  invalidateLocalNearCache(key);
  return putSuccessful;
}

Fixed version (ground truth):
protected boolean tryPutInternal(final Data key,final Data value,final long timeout,final TimeUnit timeunit){
  TryPutOperation operation=new TryPutOperation(name,key,value,getTimeInMillis(timeout,timeunit));
  boolean putSuccessful=(Boolean)invokeOperation(key,operation);
  invalidateNearCache(key);
  return putSuccessful;
}
Program: 48307
Project: 48307
Buggy source:
public ICompletableFuture executeOnKeyInternal(Data key,EntryProcessor entryProcessor,ExecutionCallback callback){
  final NodeEngine nodeEngine=getNodeEngine();
  int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
  EntryOperation operation=new EntryOperation(name,key,entryProcessor);
  operation.setThreadId(ThreadUtil.getThreadId());
  try {
    if (callback == null) {
      return nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME,operation,partitionId);
    }
 else {
      ICompletableFuture future=nodeEngine.getOperationService().createInvocationBuilder(SERVICE_NAME,operation,partitionId).setCallback(new MapExecutionCallbackAdapter(callback)).invoke();
      invalidateLocalNearCache(key);
      return future;
    }
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}

Fixed version (ground truth):
public ICompletableFuture executeOnKeyInternal(Data key,EntryProcessor entryProcessor,ExecutionCallback callback){
  final NodeEngine nodeEngine=getNodeEngine();
  int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
  EntryOperation operation=new EntryOperation(name,key,entryProcessor);
  operation.setThreadId(ThreadUtil.getThreadId());
  try {
    if (callback == null) {
      return nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME,operation,partitionId);
    }
 else {
      ICompletableFuture future=nodeEngine.getOperationService().createInvocationBuilder(SERVICE_NAME,operation,partitionId).setCallback(new MapExecutionCallbackAdapter(callback)).invoke();
      invalidateNearCache(key);
      return future;
    }
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}
Program: 48308
Project: 48308
Buggy source:
protected Data putInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  PutOperation operation=new PutOperation(name,key,value,getTimeInMillis(ttl,timeunit));
  Data previousValue=(Data)invokeOperation(key,operation);
  invalidateLocalNearCache(key);
  return previousValue;
}

Fixed version (ground truth):
protected Data putInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  PutOperation operation=new PutOperation(name,key,value,getTimeInMillis(ttl,timeunit));
  Data previousValue=(Data)invokeOperation(key,operation);
  invalidateNearCache(key);
  return previousValue;
}
Program: 48309
Project: 48309
Buggy source:
protected boolean removeInternal(final Data key,final Data value){
  RemoveIfSameOperation operation=new RemoveIfSameOperation(name,key,value);
  boolean removed=(Boolean)invokeOperation(key,operation);
  invalidateLocalNearCache(key);
  return removed;
}

Fixed version (ground truth):
protected boolean removeInternal(final Data key,final Data value){
  RemoveIfSameOperation operation=new RemoveIfSameOperation(name,key,value);
  boolean removed=(Boolean)invokeOperation(key,operation);
  invalidateNearCache(key);
  return removed;
}
Program: 48310
Project: 48310
Buggy source:
protected ICompletableFuture<Data> removeAsyncInternal(final Data key){
  final NodeEngine nodeEngine=getNodeEngine();
  int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
  RemoveOperation operation=new RemoveOperation(name,key);
  operation.setThreadId(ThreadUtil.getThreadId());
  try {
    ICompletableFuture<Data> future=nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME,operation,partitionId);
    invalidateLocalNearCache(key);
    return future;
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}

Fixed version (ground truth):
protected ICompletableFuture<Data> removeAsyncInternal(final Data key){
  final NodeEngine nodeEngine=getNodeEngine();
  int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
  RemoveOperation operation=new RemoveOperation(name,key);
  operation.setThreadId(ThreadUtil.getThreadId());
  try {
    ICompletableFuture<Data> future=nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME,operation,partitionId);
    invalidateNearCache(key);
    return future;
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}
Program: 48311
Project: 48311
Buggy source:
protected boolean tryRemoveInternal(final Data key,final long timeout,final TimeUnit timeunit){
  TryRemoveOperation operation=new TryRemoveOperation(name,key,getTimeInMillis(timeout,timeunit));
  boolean removed=(Boolean)invokeOperation(key,operation);
  invalidateLocalNearCache(key);
  return removed;
}

Fixed version (ground truth):
protected boolean tryRemoveInternal(final Data key,final long timeout,final TimeUnit timeunit){
  TryRemoveOperation operation=new TryRemoveOperation(name,key,getTimeInMillis(timeout,timeunit));
  boolean removed=(Boolean)invokeOperation(key,operation);
  invalidateNearCache(key);
  return removed;
}
Program: 48312
Project: 48312
Buggy source:
/** 
 * {@link IMap#executeOnEntries(EntryProcessor,Predicate)}
 */
public Map executeOnEntries(EntryProcessor entryProcessor,Predicate predicate){
  Map result=new HashMap();
  try {
    NodeEngine nodeEngine=getNodeEngine();
    Map<Integer,Object> results=nodeEngine.getOperationService().invokeOnAllPartitions(SERVICE_NAME,new PartitionWideEntryWithPredicateOperationFactory(name,entryProcessor,predicate));
    for (    Object o : results.values()) {
      if (o != null) {
        final MapService service=getService();
        final MapEntrySet mapEntrySet=(MapEntrySet)o;
        for (        Entry<Data,Data> entry : mapEntrySet.getEntrySet()) {
          final Data key=entry.getKey();
          result.put(service.toObject(key),service.toObject(entry.getValue()));
          invalidateLocalNearCache(key);
        }
      }
    }
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * {@link IMap#executeOnEntries(EntryProcessor,Predicate)}
 */
public Map executeOnEntries(EntryProcessor entryProcessor,Predicate predicate){
  Map result=new HashMap();
  try {
    NodeEngine nodeEngine=getNodeEngine();
    Map<Integer,Object> results=nodeEngine.getOperationService().invokeOnAllPartitions(SERVICE_NAME,new PartitionWideEntryWithPredicateOperationFactory(name,entryProcessor,predicate));
    for (    Object o : results.values()) {
      if (o != null) {
        final MapService service=getService();
        final MapEntrySet mapEntrySet=(MapEntrySet)o;
        for (        Entry<Data,Data> entry : mapEntrySet.getEntrySet()) {
          final Data key=entry.getKey();
          result.put(service.toObject(key),service.toObject(entry.getValue()));
          invalidateNearCache(key);
        }
      }
    }
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
  return result;
}
Program: 48313
Project: 48313
Buggy source:
protected ICompletableFuture<Data> putAsyncInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  final NodeEngine nodeEngine=getNodeEngine();
  int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
  PutOperation operation=new PutOperation(name,key,value,getTimeInMillis(ttl,timeunit));
  operation.setThreadId(ThreadUtil.getThreadId());
  try {
    ICompletableFuture<Data> future=nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME,operation,partitionId);
    invalidateLocalNearCache(key);
    return future;
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}

Fixed version (ground truth):
protected ICompletableFuture<Data> putAsyncInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  final NodeEngine nodeEngine=getNodeEngine();
  int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
  PutOperation operation=new PutOperation(name,key,value,getTimeInMillis(ttl,timeunit));
  operation.setThreadId(ThreadUtil.getThreadId());
  try {
    ICompletableFuture<Data> future=nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME,operation,partitionId);
    invalidateNearCache(key);
    return future;
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}
Program: 48314
Project: 48314
Buggy source:
protected void deleteInternal(Data key){
  RemoveOperation operation=new RemoveOperation(name,key);
  invokeOperation(key,operation);
  invalidateLocalNearCache(key);
}

Fixed version (ground truth):
protected void deleteInternal(Data key){
  RemoveOperation operation=new RemoveOperation(name,key);
  invokeOperation(key,operation);
  invalidateNearCache(key);
}
Program: 48315
Project: 48315
Buggy source:
protected void setInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  SetOperation operation=new SetOperation(name,key,value,timeunit.toMillis(ttl));
  invokeOperation(key,operation);
  invalidateLocalNearCache(key);
}

Fixed version (ground truth):
protected void setInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  SetOperation operation=new SetOperation(name,key,value,timeunit.toMillis(ttl));
  invokeOperation(key,operation);
  invalidateNearCache(key);
}
Program: 48317
Project: 48317
Buggy source:
public Map executeOnKeysInternal(Set<Data> keys,EntryProcessor entryProcessor){
  Map result=new HashMap();
  final NodeEngine nodeEngine=getNodeEngine();
  final Collection<Integer> partitionsForKeys=getPartitionsForKeys(keys);
  try {
    MultipleEntryOperationFactory operationFactory=new MultipleEntryOperationFactory(name,keys,entryProcessor);
    Map<Integer,Object> results=nodeEngine.getOperationService().invokeOnPartitions(SERVICE_NAME,operationFactory,partitionsForKeys);
    for (    Object o : results.values()) {
      if (o != null) {
        final MapService service=getService();
        final MapEntrySet mapEntrySet=(MapEntrySet)o;
        for (        Entry<Data,Data> entry : mapEntrySet.getEntrySet()) {
          result.put(service.toObject(entry.getKey()),service.toObject(entry.getValue()));
        }
      }
    }
    invalidateLocalNearCache(keys);
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
  return result;
}

Fixed version (ground truth):
public Map executeOnKeysInternal(Set<Data> keys,EntryProcessor entryProcessor){
  Map result=new HashMap();
  final NodeEngine nodeEngine=getNodeEngine();
  final Collection<Integer> partitionsForKeys=getPartitionsForKeys(keys);
  try {
    MultipleEntryOperationFactory operationFactory=new MultipleEntryOperationFactory(name,keys,entryProcessor);
    Map<Integer,Object> results=nodeEngine.getOperationService().invokeOnPartitions(SERVICE_NAME,operationFactory,partitionsForKeys);
    for (    Object o : results.values()) {
      if (o != null) {
        final MapService service=getService();
        final MapEntrySet mapEntrySet=(MapEntrySet)o;
        for (        Entry<Data,Data> entry : mapEntrySet.getEntrySet()) {
          result.put(service.toObject(entry.getKey()),service.toObject(entry.getValue()));
        }
      }
    }
    invalidateNearCache(keys);
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
  return result;
}
Program: 48318
Project: 48318
Buggy source:
protected Data putIfAbsentInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  PutIfAbsentOperation operation=new PutIfAbsentOperation(name,key,value,getTimeInMillis(ttl,timeunit));
  Data previousValue=(Data)invokeOperation(key,operation);
  invalidateLocalNearCache(key);
  return previousValue;
}

Fixed version (ground truth):
protected Data putIfAbsentInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  PutIfAbsentOperation operation=new PutIfAbsentOperation(name,key,value,getTimeInMillis(ttl,timeunit));
  Data previousValue=(Data)invokeOperation(key,operation);
  invalidateNearCache(key);
  return previousValue;
}
Program: 48319
Project: 48319
Buggy source:
protected void putTransientInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  PutTransientOperation operation=new PutTransientOperation(name,key,value,getTimeInMillis(ttl,timeunit));
  invokeOperation(key,operation);
  invalidateLocalNearCache(key);
}

Fixed version (ground truth):
protected void putTransientInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  PutTransientOperation operation=new PutTransientOperation(name,key,value,getTimeInMillis(ttl,timeunit));
  invokeOperation(key,operation);
  invalidateNearCache(key);
}
Program: 48320
Project: 48320
Buggy source:
protected Data replaceInternal(final Data key,final Data value){
  ReplaceOperation operation=new ReplaceOperation(name,key,value);
  final Data result=(Data)invokeOperation(key,operation);
  invalidateLocalNearCache(key);
  return result;
}

Fixed version (ground truth):
protected Data replaceInternal(final Data key,final Data value){
  ReplaceOperation operation=new ReplaceOperation(name,key,value);
  final Data result=(Data)invokeOperation(key,operation);
  invalidateNearCache(key);
  return result;
}
Program: 48321
Project: 48321
Buggy source:
public void setAttribute(final String name,final Object value){
  if (name == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (value == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (deferredWrite) {
    LocalCacheEntry entry=localCache.get(name);
    if (entry == null) {
      entry=new LocalCacheEntry();
      localCache.put(name,entry);
    }
    entry.value=value;
    entry.dirty=true;
  }
 else {
    getClusterMap().put(buildAttributeName(name),value);
  }
}

Fixed version (ground truth):
public void setAttribute(final String name,final Object value){
  if (name == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (value == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (deferredWrite) {
    LocalCacheEntry entry=localCache.get(name);
    if (entry == null || entry == NULL_ENTRY) {
      entry=new LocalCacheEntry();
      localCache.put(name,entry);
    }
    entry.value=value;
    entry.dirty=true;
  }
 else {
    getClusterMap().put(buildAttributeName(name),value);
  }
}
Program: 48322
Project: 48322
Buggy source:
public void removeAttribute(final String name){
  if (deferredWrite) {
    LocalCacheEntry entry=localCache.get(name);
    if (entry != null) {
      entry.value=null;
      entry.removed=true;
      entry.dirty=true;
    }
  }
 else {
    getClusterMap().delete(buildAttributeName(name));
  }
}

Fixed version (ground truth):
public void removeAttribute(final String name){
  if (deferredWrite) {
    LocalCacheEntry entry=localCache.get(name);
    if (entry != null && entry != NULL_ENTRY) {
      entry.value=null;
      entry.removed=true;
      entry.dirty=true;
    }
  }
 else {
    getClusterMap().delete(buildAttributeName(name));
  }
}
Program: 48323
Project: 48323
Buggy source:
public void setAttribute(final String name,final Object value){
  if (name == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (value == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (deferredWrite) {
    LocalCacheEntry entry=localCache.get(name);
    if (entry == null) {
      entry=new LocalCacheEntry();
      localCache.put(name,entry);
    }
    entry.value=value;
    entry.dirty=true;
  }
 else {
    getClusterMap().put(buildAttributeName(name),value);
  }
}

Fixed version (ground truth):
public void setAttribute(final String name,final Object value){
  if (name == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (value == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (deferredWrite) {
    LocalCacheEntry entry=localCache.get(name);
    if (entry == null || entry == NULL_ENTRY) {
      entry=new LocalCacheEntry();
      localCache.put(name,entry);
    }
    entry.value=value;
    entry.dirty=true;
  }
 else {
    getClusterMap().put(buildAttributeName(name),value);
  }
}
Program: 48324
Project: 48324
Buggy source:
public void removeAttribute(final String name){
  if (deferredWrite) {
    LocalCacheEntry entry=localCache.get(name);
    if (entry != null) {
      entry.value=null;
      entry.removed=true;
      entry.dirty=true;
    }
  }
 else {
    getClusterMap().delete(buildAttributeName(name));
  }
}

Fixed version (ground truth):
public void removeAttribute(final String name){
  if (deferredWrite) {
    LocalCacheEntry entry=localCache.get(name);
    if (entry != null && entry != NULL_ENTRY) {
      entry.value=null;
      entry.removed=true;
      entry.dirty=true;
    }
  }
 else {
    getClusterMap().delete(buildAttributeName(name));
  }
}
Program: 48325
Project: 48325
Buggy source:
boolean offerInternal(Data data,long timeout) throws InterruptedException {
  throwExceptionIfNull(data);
  OfferOperation operation=new OfferOperation(name,timeout,data);
  try {
    return invokeAndGet(operation);
  }
 catch (  Throwable throwable) {
    throw ExceptionUtil.rethrowAllowInterrupted(throwable);
  }
}

Fixed version (ground truth):
boolean offerInternal(Data data,long timeout) throws InterruptedException {
  throwExceptionIfNull(data);
  OfferOperation operation=new OfferOperation(name,timeout,data);
  try {
    return (Boolean)invokeAndGet(operation);
  }
 catch (  Throwable throwable) {
    throw ExceptionUtil.rethrowAllowInterrupted(throwable);
  }
}
Program: 48326
Project: 48326
Buggy source:
private void runAsynchronous(final ExecutionCallback<E> callback,Executor executor){
  executor.execute(new Runnable(){
    @Override public void run(){
      try {
        Object resp=resolveResponse(response);
        if (resp == null || !(resp instanceof Throwable)) {
          callback.onResponse((E)resp);
        }
 else {
          callback.onFailure((Throwable)resp);
        }
      }
 catch (      Throwable t) {
        basicInvocation.logger.severe("String_Node_Str" + basicInvocation,t);
      }
    }
  }
);
}

Fixed version (ground truth):
private void runAsynchronous(final ExecutionCallback<E> callback,Executor executor){
  try {
    executor.execute(new Runnable(){
      @Override public void run(){
        try {
          Object resp=resolveResponse(response);
          if (resp == null || !(resp instanceof Throwable)) {
            callback.onResponse((E)resp);
          }
 else {
            callback.onFailure((Throwable)resp);
          }
        }
 catch (        Throwable t) {
          basicInvocation.logger.severe("String_Node_Str" + basicInvocation,t);
        }
      }
    }
);
  }
 catch (  RejectedExecutionException ignore) {
    basicInvocation.logger.finest(ignore);
  }
}
Program: 48328
Project: 48328
Buggy source:
private void logBackupVersionMismatch(long currentVersion){
  getLogger().info("String_Node_Str" + "String_Node_Str" + currentVersion + "String_Node_Str"+ version);
}

Fixed version (ground truth):
private void logBackupVersionMismatch(long currentVersion){
  ILogger logger=getLogger();
  if (logger.isFinestEnabled()) {
    logger.finest("String_Node_Str" + getPartitionId() + "String_Node_Str"+ currentVersion+ "String_Node_Str"+ version);
  }
}
Program: 48329
Project: 48329
Buggy source:
@Override public void run() throws Exception {
  InternalPartitionServiceImpl partitionService=getService();
  int partitionId=getPartitionId();
  int replicaIndex=getReplicaIndex();
  long[] currentVersions=partitionService.getPartitionReplicaVersions(partitionId);
  long currentVersion=currentVersions[replicaIndex - 1];
  if (currentVersion == version) {
    response=true;
  }
 else {
    logBackupVersionMismatch(currentVersion);
    partitionService.syncPartitionReplica(partitionId,replicaIndex,false);
    response=false;
  }
}

Fixed version (ground truth):
@Override public void run() throws Exception {
  InternalPartitionServiceImpl partitionService=getService();
  int partitionId=getPartitionId();
  int replicaIndex=getReplicaIndex();
  long[] currentVersions=partitionService.getPartitionReplicaVersions(partitionId);
  long currentVersion=currentVersions[replicaIndex - 1];
  if (currentVersion == version) {
    response=true;
  }
 else {
    logBackupVersionMismatch(currentVersion);
    partitionService.triggerPartitionReplicaSync(partitionId,replicaIndex);
    response=false;
  }
}
Program: 48330
Project: 48330
Buggy source:
@Override public void run(){
  InternalPartitionServiceImpl partitionService=getService();
  MigrationInfo migrationInfo=partitionService.getActiveMigration(getPartitionId());
  if (migrationInfo == null) {
    return;
  }
  NodeEngineImpl nodeEngine=(NodeEngineImpl)getNodeEngine();
  PartitionMigrationEvent event=new PartitionMigrationEvent(endpoint,getPartitionId());
  for (  MigrationAwareService service : nodeEngine.getServices(MigrationAwareService.class)) {
    finishMigration(event,service);
  }
  partitionService.removeActiveMigration(getPartitionId());
  if (success) {
    nodeEngine.onPartitionMigrate(migrationInfo);
  }
}

Fixed version (ground truth):
@Override public void run(){
  InternalPartitionServiceImpl partitionService=getService();
  int partitionId=getPartitionId();
  MigrationInfo migrationInfo=partitionService.getActiveMigration(partitionId);
  if (migrationInfo == null) {
    return;
  }
  NodeEngineImpl nodeEngine=(NodeEngineImpl)getNodeEngine();
  PartitionMigrationEvent event=new PartitionMigrationEvent(endpoint,partitionId);
  for (  MigrationAwareService service : nodeEngine.getServices(MigrationAwareService.class)) {
    finishMigration(event,service);
  }
  partitionService.removeActiveMigration(partitionId);
  if (success) {
    nodeEngine.onPartitionMigrate(migrationInfo);
  }
}
Program: 48332
Project: 48332
Buggy source:
private void logBackupVersionMismatch(long currentVersion){
  getLogger().info("String_Node_Str" + "String_Node_Str" + currentVersion + "String_Node_Str"+ version);
}

Fixed version (ground truth):
private void logBackupVersionMismatch(long currentVersion){
  ILogger logger=getLogger();
  if (logger.isFinestEnabled()) {
    logger.finest("String_Node_Str" + getPartitionId() + "String_Node_Str"+ currentVersion+ "String_Node_Str"+ version);
  }
}
Program: 48333
Project: 48333
Buggy source:
@Override public void run() throws Exception {
  InternalPartitionServiceImpl partitionService=getService();
  int partitionId=getPartitionId();
  int replicaIndex=getReplicaIndex();
  long[] currentVersions=partitionService.getPartitionReplicaVersions(partitionId);
  long currentVersion=currentVersions[replicaIndex - 1];
  if (currentVersion == version) {
    response=true;
  }
 else {
    logBackupVersionMismatch(currentVersion);
    partitionService.syncPartitionReplica(partitionId,replicaIndex,false);
    response=false;
  }
}

Fixed version (ground truth):
@Override public void run() throws Exception {
  InternalPartitionServiceImpl partitionService=getService();
  int partitionId=getPartitionId();
  int replicaIndex=getReplicaIndex();
  long[] currentVersions=partitionService.getPartitionReplicaVersions(partitionId);
  long currentVersion=currentVersions[replicaIndex - 1];
  if (currentVersion == version) {
    response=true;
  }
 else {
    logBackupVersionMismatch(currentVersion);
    partitionService.triggerPartitionReplicaSync(partitionId,replicaIndex);
    response=false;
  }
}
Program: 48334
Project: 48334
Buggy source:
@Override public void run(){
  InternalPartitionServiceImpl partitionService=getService();
  MigrationInfo migrationInfo=partitionService.getActiveMigration(getPartitionId());
  if (migrationInfo == null) {
    return;
  }
  NodeEngineImpl nodeEngine=(NodeEngineImpl)getNodeEngine();
  PartitionMigrationEvent event=new PartitionMigrationEvent(endpoint,getPartitionId());
  for (  MigrationAwareService service : nodeEngine.getServices(MigrationAwareService.class)) {
    finishMigration(event,service);
  }
  partitionService.removeActiveMigration(getPartitionId());
  if (success) {
    nodeEngine.onPartitionMigrate(migrationInfo);
  }
}

Fixed version (ground truth):
@Override public void run(){
  InternalPartitionServiceImpl partitionService=getService();
  int partitionId=getPartitionId();
  MigrationInfo migrationInfo=partitionService.getActiveMigration(partitionId);
  if (migrationInfo == null) {
    return;
  }
  NodeEngineImpl nodeEngine=(NodeEngineImpl)getNodeEngine();
  PartitionMigrationEvent event=new PartitionMigrationEvent(endpoint,partitionId);
  for (  MigrationAwareService service : nodeEngine.getServices(MigrationAwareService.class)) {
    finishMigration(event,service);
  }
  partitionService.removeActiveMigration(partitionId);
  if (success) {
    nodeEngine.onPartitionMigrate(migrationInfo);
  }
}
Program: 48336
Project: 48336
Buggy source:
public LoggingServiceImpl(SystemLogService systemLogService,String groupName,String loggingType,MemberImpl thisMember,BuildInfo buildInfo){
  this.systemLogService=systemLogService;
  this.groupName=groupName;
  this.thisMember=thisMember;
  this.loggerFactory=Logger.newLoggerFactory(loggingType);
  this.thisAddressString="String_Node_Str" + thisMember.getAddress().getHost() + "String_Node_Str"+ thisMember.getAddress().getPort();
  this.buildInfo=buildInfo;
}

Fixed version (ground truth):
public LoggingServiceImpl(SystemLogService systemLogService,String groupName,String loggingType,BuildInfo buildInfo){
  this.systemLogService=systemLogService;
  this.groupName=groupName;
  this.loggerFactory=Logger.newLoggerFactory(loggingType);
  this.buildInfo=buildInfo;
}
Program: 48338
Project: 48338
Buggy source:
public LoggingServiceImpl(SystemLogService systemLogService,String groupName,String loggingType,MemberImpl thisMember,BuildInfo buildInfo){
  this.systemLogService=systemLogService;
  this.groupName=groupName;
  this.thisMember=thisMember;
  this.loggerFactory=Logger.newLoggerFactory(loggingType);
  this.thisAddressString="String_Node_Str" + thisMember.getAddress().getHost() + "String_Node_Str"+ thisMember.getAddress().getPort();
  this.buildInfo=buildInfo;
}

Fixed version (ground truth):
public LoggingServiceImpl(SystemLogService systemLogService,String groupName,String loggingType,BuildInfo buildInfo){
  this.systemLogService=systemLogService;
  this.groupName=groupName;
  this.loggerFactory=Logger.newLoggerFactory(loggingType);
  this.buildInfo=buildInfo;
}
Program: 48339
Project: 48339
Buggy source:
@Test public void testNearCachePopulatedAndHitsGenerated2() throws Exception {
  final IMap map=client.getMap(mapWithBasicCash + randomString());
  final int size=1278;
  for (int i=0; i < size; i++) {
    map.put(i,i);
  }
  for (int i=0; i < size; i++) {
    map.get(i);
  }
  for (int i=0; i < size; i++) {
    map.get(i);
  }
  NearCacheStats stats=map.getLocalMapStats().getNearCacheStats();
  System.out.println("String_Node_Str" + stats);
  assertEquals(size,stats.getOwnedEntryCount());
  assertEquals(size,stats.getHits());
}

Fixed version (ground truth):
@Test public void testNearCachePopulatedAndHitsGenerated2() throws Exception {
  final IMap map=client.getMap(mapWithBasicCashNoInvalidation + randomString());
  final int size=1278;
  for (int i=0; i < size; i++) {
    map.put(i,i);
  }
  for (int i=0; i < size; i++) {
    map.get(i);
  }
  for (int i=0; i < size; i++) {
    map.get(i);
  }
  NearCacheStats stats=map.getLocalMapStats().getNearCacheStats();
  System.out.println("String_Node_Str" + stats);
  assertEquals(size,stats.getOwnedEntryCount());
  assertEquals(size,stats.getHits());
}
Program: 48340
Project: 48340
Buggy source:
@Test public void testNearCacheMisses(){
  final IMap map=client.getMap(mapWithBasicCash + randomString());
  final int size=1321;
  for (int i=0; i < size; i++) {
    map.get("String_Node_Str" + i);
  }
  NearCacheStats stats=map.getLocalMapStats().getNearCacheStats();
  assertEquals(size,stats.getMisses());
  assertEquals(size,stats.getOwnedEntryCount());
}

Fixed version (ground truth):
@Test public void testNearCacheMisses(){
  final IMap map=client.getMap(mapWithBasicCashNoInvalidation + randomString());
  final int size=1321;
  for (int i=0; i < size; i++) {
    map.get("String_Node_Str" + i);
  }
  NearCacheStats stats=map.getLocalMapStats().getNearCacheStats();
  assertEquals(size,stats.getMisses());
  assertEquals(size,stats.getOwnedEntryCount());
}
Program: 48341
Project: 48341
Buggy source:
@Test @Category(ProblematicTest.class) public void testNearCachePopulatedAndHitsGenerated() throws Exception {
  final IMap map=client.getMap(mapWithBasicCash + randomString());
  final int size=1278;
  for (int i=0; i < size; i++) {
    map.put(i,i);
    map.get(i);
    map.get(i);
  }
  NearCacheStats stats=map.getLocalMapStats().getNearCacheStats();
  System.out.println("String_Node_Str" + stats);
  assertEquals(size,stats.getOwnedEntryCount());
  assertEquals(size,stats.getHits());
}

Fixed version (ground truth):
@Test public void testNearCachePopulatedAndHitsGenerated() throws Exception {
  final IMap map=client.getMap(mapWithBasicCashNoInvalidation + randomString());
  final int size=1278;
  for (int i=0; i < size; i++) {
    map.put(i,i);
    map.get(i);
    map.get(i);
  }
  NearCacheStats stats=map.getLocalMapStats().getNearCacheStats();
  System.out.println("String_Node_Str" + stats);
  assertEquals(size,stats.getOwnedEntryCount());
  assertEquals(size,stats.getHits());
}
Program: 48342
Project: 48342
Buggy source:
@Test public void testGetNearCacheStatsBeforePopulation(){
  final IMap map=client.getMap(mapWithBasicCash + randomString());
  final int size=101;
  for (int i=0; i < size; i++) {
    map.put(i,i);
  }
  final NearCacheStats stats=map.getLocalMapStats().getNearCacheStats();
  assertNotNull(stats);
}

Fixed version (ground truth):
@Test public void testGetNearCacheStatsBeforePopulation(){
  final IMap map=client.getMap(mapWithBasicCashNoInvalidation + randomString());
  final int size=101;
  for (int i=0; i < size; i++) {
    map.put(i,i);
  }
  final NearCacheStats stats=map.getLocalMapStats().getNearCacheStats();
  assertNotNull(stats);
}
Program: 48343
Project: 48343
Buggy source:
@BeforeClass public static void setup() throws Exception {
  h1=Hazelcast.newHazelcastInstance();
  h2=Hazelcast.newHazelcastInstance();
  ClientConfig clientConfig=new ClientConfig();
  NearCacheConfig basicConfig=new NearCacheConfig();
  basicConfig.setInMemoryFormat(InMemoryFormat.OBJECT);
  clientConfig.addNearCacheConfig(mapWithBasicCash + "String_Node_Str",basicConfig);
  NearCacheConfig maxSizeConfig=new NearCacheConfig();
  maxSizeConfig.setMaxSize(MAX_CACHE_SIZE);
  clientConfig.addNearCacheConfig(mapWithMaxSizeCash + "String_Node_Str",maxSizeConfig);
  NearCacheConfig ttlConfig=new NearCacheConfig();
  ttlConfig.setTimeToLiveSeconds(MAX_TTL_SECONDS);
  clientConfig.addNearCacheConfig(mapWithTTLCash + "String_Node_Str",ttlConfig);
  NearCacheConfig idleConfig=new NearCacheConfig();
  idleConfig.setMaxIdleSeconds(MAX_IDLE_SECONDS);
  clientConfig.addNearCacheConfig(mapWithIdleCash + "String_Node_Str",idleConfig);
  NearCacheConfig invalidateConfig=new NearCacheConfig();
  invalidateConfig.setInvalidateOnChange(true);
  clientConfig.addNearCacheConfig(mapWithInvalidateCash + "String_Node_Str",invalidateConfig);
  client=HazelcastClient.newHazelcastClient(clientConfig);
}

Fixed version (ground truth):
@BeforeClass public static void setup() throws Exception {
  h1=Hazelcast.newHazelcastInstance();
  h2=Hazelcast.newHazelcastInstance();
  ClientConfig clientConfig=new ClientConfig();
  NearCacheConfig basicConfig=new NearCacheConfig();
  basicConfig.setInMemoryFormat(InMemoryFormat.OBJECT);
  clientConfig.addNearCacheConfig(mapWithBasicCash + "String_Node_Str",basicConfig);
  NearCacheConfig basicConfigNoInvalidation=new NearCacheConfig();
  basicConfig.setInMemoryFormat(InMemoryFormat.OBJECT);
  basicConfigNoInvalidation.setInvalidateOnChange(false);
  clientConfig.addNearCacheConfig(mapWithBasicCashNoInvalidation + "String_Node_Str",basicConfigNoInvalidation);
  NearCacheConfig maxSizeConfig=new NearCacheConfig();
  maxSizeConfig.setMaxSize(MAX_CACHE_SIZE);
  clientConfig.addNearCacheConfig(mapWithMaxSizeCash + "String_Node_Str",maxSizeConfig);
  NearCacheConfig ttlConfig=new NearCacheConfig();
  ttlConfig.setTimeToLiveSeconds(MAX_TTL_SECONDS);
  clientConfig.addNearCacheConfig(mapWithTTLCash + "String_Node_Str",ttlConfig);
  NearCacheConfig idleConfig=new NearCacheConfig();
  idleConfig.setMaxIdleSeconds(MAX_IDLE_SECONDS);
  clientConfig.addNearCacheConfig(mapWithIdleCash + "String_Node_Str",idleConfig);
  NearCacheConfig invalidateConfig=new NearCacheConfig();
  invalidateConfig.setInvalidateOnChange(true);
  clientConfig.addNearCacheConfig(mapWithInvalidateCash + "String_Node_Str",invalidateConfig);
  client=HazelcastClient.newHazelcastClient(clientConfig);
}
Program: 48344
Project: 48344
Buggy source:
@Test public void testNearCacheStats() throws Exception {
  String mapName="String_Node_Str";
  Config config=new Config();
  config.getMapConfig(mapName).setNearCacheConfig(new NearCacheConfig().setInvalidateOnChange(true));
  TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(2);
  HazelcastInstance[] instances=factory.newInstances(config);
  IMap<Integer,Integer> map=instances[0].getMap("String_Node_Str");
  for (int i=0; i < 1000; i++) {
    map.put(i,i);
  }
  for (int i=0; i < 1000; i++) {
    map.get(i);
  }
  NearCacheStats stats=map.getLocalMapStats().getNearCacheStats();
  assertTrue("String_Node_Str",400 < stats.getOwnedEntryCount());
  assertTrue("String_Node_Str",1000 == stats.getMisses());
  for (int i=0; i < 1000; i++) {
    map.get(i);
  }
  NearCacheStats stats2=map.getLocalMapStats().getNearCacheStats();
  assertTrue("String_Node_Str",400 < stats2.getHits());
  assertTrue("String_Node_Str",400 < stats2.getMisses());
  assertTrue("String_Node_Str",2000 == stats2.getHits() + stats2.getMisses());
}

Fixed version (ground truth):
@Test public void testNearCacheStats() throws Exception {
  String mapName=randomMapName();
  Config config=new Config();
  config.getMapConfig(mapName).setNearCacheConfig(new NearCacheConfig().setInvalidateOnChange(false));
  TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(2);
  HazelcastInstance[] instances=factory.newInstances(config);
  IMap<Integer,Integer> map=instances[0].getMap(mapName);
  for (int i=0; i < 1000; i++) {
    map.put(i,i);
  }
  for (int i=0; i < 1000; i++) {
    map.get(i);
  }
  NearCacheStats stats=map.getLocalMapStats().getNearCacheStats();
  assertTrue("String_Node_Str",400 < stats.getOwnedEntryCount());
  assertTrue("String_Node_Str",1000 == stats.getMisses());
  for (int i=0; i < 1000; i++) {
    map.get(i);
  }
  NearCacheStats stats2=map.getLocalMapStats().getNearCacheStats();
  assertTrue("String_Node_Str",400 < stats2.getHits());
  assertTrue("String_Node_Str",400 < stats2.getMisses());
  assertTrue("String_Node_Str",2000 == stats2.getHits() + stats2.getMisses());
}