nus-yam/ex-repair huggingface dataset:
Program: 163027
Project: 163027
Buggy source:
@Test public void testEquals() throws IOException, InterruptedException {
  final ChronicleMap<Integer,CharSequence> serverMap1;
  final ChronicleMap<Integer,CharSequence> serverMap2;
  final ChronicleMap<Integer,CharSequence> statelessMap1;
  final ChronicleMap<Integer,CharSequence> statelessMap2;
{
    statelessMap1=ChronicleMapBuilder.of(Integer.class,CharSequence.class).stateless(remoteAddress(new InetSocketAddress("String_Node_Str",8076))).create();
    statelessMap2=ChronicleMapBuilder.of(Integer.class,CharSequence.class).stateless(remoteAddress(new InetSocketAddress("String_Node_Str",8077))).create();
  }
{
    serverMap1=ChronicleMapBuilder.of(Integer.class,CharSequence.class).replicators((byte)2,TcpReplicationConfig.of(8076)).create();
    serverMap2=ChronicleMapBuilder.of(Integer.class,CharSequence.class).replicators((byte)2,TcpReplicationConfig.of(8077)).create();
  }
  Map<Integer,CharSequence> payload=new HashMap<Integer,CharSequence>();
  for (int i=0; i < 1000; i++) {
    payload.put(i,"String_Node_Str" + i);
  }
  statelessMap1.putAll(payload);
  Assert.assertTrue(statelessMap1.equals(payload));
  statelessMap1.close();
  statelessMap1.close();
  serverMap1.close();
  serverMap2.close();
}

Fixed version (ground truth):
@Test public void testEquals() throws IOException, InterruptedException {
  final ChronicleMap<Integer,CharSequence> serverMap1;
  final ChronicleMap<Integer,CharSequence> serverMap2;
  final ChronicleMap<Integer,CharSequence> statelessMap1;
  final ChronicleMap<Integer,CharSequence> statelessMap2;
{
    statelessMap1=ChronicleMapBuilder.of(Integer.class,CharSequence.class).stateless(remoteAddress(new InetSocketAddress("String_Node_Str",8076))).create();
    statelessMap2=ChronicleMapBuilder.of(Integer.class,CharSequence.class).stateless(remoteAddress(new InetSocketAddress("String_Node_Str",8077))).create();
  }
{
    serverMap1=ChronicleMapBuilder.of(Integer.class,CharSequence.class).replicators((byte)2,TcpReplicationConfig.of(8076)).create();
    serverMap2=ChronicleMapBuilder.of(Integer.class,CharSequence.class).replicators((byte)2,TcpReplicationConfig.of(8077)).create();
  }
  Map<Integer,CharSequence> payload=new HashMap<Integer,CharSequence>();
  for (int i=0; i < 1000; i++) {
    payload.put(i,"String_Node_Str" + i);
  }
  statelessMap1.putAll(payload);
  Assert.assertTrue(statelessMap1.equals(payload));
  statelessMap1.close();
  statelessMap2.close();
  serverMap1.close();
  serverMap2.close();
}
Program: 163028
Project: 163028
Buggy source:
private Bytes blockingFetchThrowable(long sizeLocation,long timeOutMs,final long transactionId,final long startTime) throws IOException {
  long timeoutTime=startTime + timeOutMs + 1000000;
  for (; ; ) {
    if (clientChannel == null)     clientChannel=lazyConnect(builder.timeoutMs(),builder.remoteAddress());
    try {
      if (LOG.isDebugEnabled())       LOG.debug("String_Node_Str" + transactionId);
      write(transactionId);
      writeSizeAt(sizeLocation);
      send(bytes,timeoutTime);
      return blockingFetch(timeoutTime,transactionId);
    }
 catch (    java.nio.channels.ClosedChannelException|ClosedConnectionException e) {
      checkTimeout(timeoutTime);
      clientChannel=lazyConnect(builder.timeoutMs(),builder.remoteAddress());
    }
  }
}

Fixed version (ground truth):
private Bytes blockingFetchThrowable(long sizeLocation,long timeOutMs,final long transactionId,final long startTime) throws IOException {
  long timeoutTime=startTime + timeOutMs;
  for (; ; ) {
    if (clientChannel == null)     clientChannel=lazyConnect(builder.timeoutMs(),builder.remoteAddress());
    try {
      if (LOG.isDebugEnabled())       LOG.debug("String_Node_Str" + transactionId);
      write(transactionId);
      writeSizeAt(sizeLocation);
      send(bytes,timeoutTime);
      bytes.clear();
      bytes.buffer().clear();
      return blockingFetch(timeoutTime,transactionId);
    }
 catch (    java.nio.channels.ClosedChannelException|ClosedConnectionException e) {
      checkTimeout(timeoutTime);
      clientChannel=lazyConnect(builder.timeoutMs(),builder.remoteAddress());
    }
  }
}
Program: 163029
Project: 163029
Buggy source:
@NotNull public synchronized Set<Map.Entry<K,V>> entrySet(){
  final long sizeLocation=writeEvent(ENTRY_SET);
  final long startTime=System.currentTimeMillis();
  final long transactionId=nextUniqueTransaction(startTime);
  final long timeoutTime=System.currentTimeMillis() + builder.timeoutMs();
  Bytes in=blockingFetch0(sizeLocation,transactionId,startTime);
  final Set<Map.Entry<K,V>> result=new HashSet<Map.Entry<K,V>>();
  for (; ; ) {
    boolean hasMoreEntries=in.readBoolean();
    LOG.info("String_Node_Str" + hasMoreEntries);
    long size=in.readInt();
    for (int i=0; i < size; i++) {
      K k=keyValueSerializer.readKey(in);
      V v=keyValueSerializer.readValue(in);
      result.add(new Entry(k,v));
    }
    if (!hasMoreEntries)     break;
    in=blockingFetchReadOnly(timeoutTime,transactionId);
  }
  return result;
}

Fixed version (ground truth):
@NotNull public synchronized Set<Map.Entry<K,V>> entrySet(){
  final long sizeLocation=writeEvent(ENTRY_SET);
  final long startTime=System.currentTimeMillis();
  final long transactionId=nextUniqueTransaction(startTime);
  final long timeoutTime=System.currentTimeMillis() + builder.timeoutMs();
  Bytes in=blockingFetch0(sizeLocation,transactionId,startTime);
  final Set<Map.Entry<K,V>> result=new HashSet<Map.Entry<K,V>>();
  int count=0;
  long total=0;
  for (; ; ) {
    boolean hasMoreEntries=in.readBoolean();
    count++;
    long size=in.readInt();
    for (int i=0; i < size; i++) {
      total++;
      K k=keyValueSerializer.readKey(in);
      V v=keyValueSerializer.readValue(in);
      result.add(new Entry(k,v));
    }
    if (!hasMoreEntries)     break;
    if (in.remaining() == 0) {
      bytes.clear();
      bytes.buffer().clear();
    }
 else {
      buffer.compact();
    }
    in=blockingFetchReadOnly(timeoutTime,transactionId);
  }
  LOG.info("String_Node_Str" + total);
  return result;
}
Program: 163030
Project: 163030
Buggy source:
private Bytes blockingFetch(long timeoutTime,long transactionId) throws IOException {
  bytes.clear();
  bytes.buffer().clear();
  int size=receive(SIZE_OF_SIZE,timeoutTime).readInt();
  int requiredSize=size + SIZE_OF_SIZE;
  if (bytes.capacity() < requiredSize) {
    bytes=new ByteBufferBytes(allocateDirect(requiredSize));
  }
  receive(size,timeoutTime);
  boolean isException=bytes.readBoolean();
  long inTransactionId=bytes.readLong();
  if (inTransactionId != transactionId)   throw new IllegalStateException("String_Node_Str" + inTransactionId + "String_Node_Str"+ transactionId);
  if (isException)   throw (RuntimeException)bytes.readObject();
  return bytes;
}

Fixed version (ground truth):
private Bytes blockingFetch(long timeoutTime,long transactionId) throws IOException {
  int size=receive(SIZE_OF_SIZE,timeoutTime).readInt();
  int requiredSize=size + SIZE_OF_SIZE;
  if (bytes.capacity() < requiredSize) {
    bytes=new ByteBufferBytes(allocateDirect(requiredSize));
  }
  receive(size,timeoutTime);
  boolean isException=bytes.readBoolean();
  long inTransactionId=bytes.readLong();
  if (inTransactionId != transactionId)   throw new IllegalStateException("String_Node_Str" + inTransactionId + "String_Node_Str"+ transactionId);
  if (isException)   throw (RuntimeException)bytes.readObject();
  return bytes;
}
Program: 163031
Project: 163031
Buggy source:
private Work entrySet(Bytes reader,Bytes writer){
  final long transactionId=reader.readLong();
  final Set<Map.Entry<K,V>> entries;
  try {
    entries=map.entrySet();
  }
 catch (  RuntimeException e) {
    return sendException(reader,writer,e);
  }
  final Iterator<Map.Entry<K,V>> iterator=entries.iterator();
  return new Work(){
    @Override public boolean doWork(    Bytes writer){
      final long sizeLocation=header(writer,transactionId);
      int count=0;
      while (iterator.hasNext()) {
        if (writer.remaining() <= maxEntrySizeBytes) {
          writeHeader(writer,sizeLocation,count,true);
          return false;
        }
        count++;
        final Map.Entry<K,V> next=iterator.next();
        writeKey(next.getKey(),writer);
        writeValue(next.getValue(),writer);
      }
      writeHeader(writer,sizeLocation,count,false);
      return true;
    }
  }
;
}

Fixed version (ground truth):
private Work entrySet(final Bytes reader,Bytes writer){
  final long transactionId=reader.readLong();
  final Set<Map.Entry<K,V>> entries;
  try {
    entries=map.entrySet();
  }
 catch (  RuntimeException e) {
    return sendException(reader,writer,e);
  }
  LOG.info("String_Node_Str" + map.size());
  final AtomicInteger i=new AtomicInteger(0);
  final Iterator<Map.Entry<K,V>> iterator=entries.iterator();
  return new Work(){
    @Override public boolean doWork(    Bytes writer){
      if (writer.remaining() <= maxEntrySizeBytes)       return false;
      final long sizeLocation=header(writer,transactionId);
      int count=0;
      while (iterator.hasNext()) {
        if (writer.remaining() <= maxEntrySizeBytes) {
          writeHeader(writer,sizeLocation,count,true,i.incrementAndGet());
          return false;
        }
        count++;
        final Map.Entry<K,V> next=iterator.next();
        writeKey(next.getKey(),writer);
        writeValue(next.getValue(),writer);
      }
      writeHeader(writer,sizeLocation,count,false,i.incrementAndGet());
      return true;
    }
  }
;
}
Program: 163032
Project: 163032
Buggy source:
private void writeHeader(Bytes writer,long sizeLocation,int count,final boolean hasAnotherChunk){
  final long end=writer.position();
  final int size=(int)(end - sizeLocation);
  writer.position(sizeLocation);
  writer.writeInt(size);
  writer.writeBoolean(false);
  writer.skip(8);
  writer.writeBoolean(hasAnotherChunk);
  writer.writeInt(count);
  writer.position(end);
}

Fixed version (ground truth):
private void writeHeader(Bytes writer,long sizeLocation,int count,final boolean hasAnotherChunk,int seq){
  final long end=writer.position();
  final int size=(int)(end - sizeLocation);
  writer.position(sizeLocation);
  writer.writeInt(size);
  writer.writeBoolean(false);
  writer.skip(8);
  writer.writeBoolean(hasAnotherChunk);
  writer.writeInt(count);
  writer.position(end);
}
Program: 163033
Project: 163033
Buggy source:
/** 
 * called when the selector receives a OP_WRITE message
 */
private void onWrite(@NotNull final SelectionKey key,final long approxTime) throws InterruptedException, IOException {
  final SocketChannel socketChannel=(SocketChannel)key.channel();
  final Attached attached=(Attached)key.attachment();
  if (attached.entryWriter.isWorkIncomplete()) {
    boolean completed=attached.entryWriter.doWork();
    if (completed)     attached.entryWriter.workCompleted();
    attached.hasRemoteHeartbeatInterval=false;
  }
 else   if (attached.remoteModificationIterator != null)   attached.entryWriter.entriesToBuffer(attached.remoteModificationIterator,key);
  try {
    int bytesJustWritten=attached.entryWriter.writeBufferToSocket(socketChannel,approxTime);
    contemplateThrottleWrites(bytesJustWritten);
  }
 catch (  IOException e) {
    quietClose(key,e);
    if (!attached.isServer)     attached.connector.connectLater();
    throw e;
  }
}

Fixed version (ground truth):
/** 
 * called when the selector receives a OP_WRITE message
 */
private void onWrite(@NotNull final SelectionKey key,final long approxTime) throws InterruptedException, IOException {
  final SocketChannel socketChannel=(SocketChannel)key.channel();
  final Attached attached=(Attached)key.attachment();
  if (attached.entryWriter.isWorkIncomplete()) {
    boolean completed=attached.entryWriter.doWork();
    if (completed)     attached.entryWriter.workCompleted();
    attached.hasRemoteHeartbeatInterval=false;
  }
 else   if (attached.remoteModificationIterator != null)   attached.entryWriter.entriesToBuffer(attached.remoteModificationIterator,key);
  try {
    int bytesJustWritten=attached.entryWriter.writeBufferToSocket(socketChannel,approxTime);
    if (bytesJustWritten > 0)     contemplateThrottleWrites(bytesJustWritten);
  }
 catch (  IOException e) {
    quietClose(key,e);
    if (!attached.isServer)     attached.connector.connectLater();
    throw e;
  }
}
Program: 163035
Project: 163035
Buggy source:
@Override public boolean doWork(Bytes writer){
  final long sizeLocation=header(writer,transactionId);
  int count=0;
  while (iterator.hasNext()) {
    if (writer.remaining() <= maxEntrySizeBytes) {
      writeHeader(writer,sizeLocation,count,true);
      return false;
    }
    count++;
    final Map.Entry<K,V> next=iterator.next();
    writeKey(next.getKey(),writer);
    writeValue(next.getValue(),writer);
  }
  writeHeader(writer,sizeLocation,count,false);
  return true;
}

Fixed version (ground truth):
@Override public boolean doWork(Bytes writer){
  if (writer.remaining() <= maxEntrySizeBytes)   return false;
  final long sizeLocation=header(writer,transactionId);
  int count=0;
  while (iterator.hasNext()) {
    if (writer.remaining() <= maxEntrySizeBytes) {
      writeHeader(writer,sizeLocation,count,true,i.incrementAndGet());
      return false;
    }
    count++;
    final Map.Entry<K,V> next=iterator.next();
    writeKey(next.getKey(),writer);
    writeValue(next.getValue(),writer);
  }
  writeHeader(writer,sizeLocation,count,false,i.incrementAndGet());
  return true;
}
Program: 163036
Project: 163036
Buggy source:
private Work keySet(Bytes reader,final Bytes writer){
  final long transactionId=reader.readLong();
  Set<K> ks;
  try {
    ks=map.keySet();
  }
 catch (  RuntimeException e) {
    return sendException(reader,writer,e);
  }
  final Iterator<K> iterator=ks.iterator();
  return new Work(){
    @Override public boolean doWork(    Bytes writer){
      final long sizeLocation=header(writer,transactionId);
      int count=0;
      while (iterator.hasNext()) {
        if (writer.remaining() <= maxEntrySizeBytes) {
          writeHeader(writer,sizeLocation,count,true);
          return false;
        }
        count++;
        K key=iterator.next();
        writeKey(key,writer);
      }
      writeHeader(writer,sizeLocation,count,false);
      return true;
    }
  }
;
}

Fixed version (ground truth):
private Work keySet(Bytes reader,final Bytes writer){
  final long transactionId=reader.readLong();
  Set<K> ks;
  try {
    ks=map.keySet();
  }
 catch (  RuntimeException e) {
    return sendException(reader,writer,e);
  }
  final Iterator<K> iterator=ks.iterator();
  return new Work(){
    @Override public boolean doWork(    Bytes writer){
      final long sizeLocation=header(writer,transactionId);
      int count=0;
      while (iterator.hasNext()) {
        if (writer.remaining() <= maxEntrySizeBytes) {
          writeHeader(writer,sizeLocation,count,true,0);
          return false;
        }
        count++;
        K key=iterator.next();
        writeKey(key,writer);
      }
      writeHeader(writer,sizeLocation,count,false,0);
      return true;
    }
  }
;
}
Program: 163037
Project: 163037
Buggy source:
/** 
 * writes the contents of the buffer to the socket
 * @param socketChannel the socket to publish the buffer to
 * @param approxTime    an approximation of the current time in millis
 * @throws IOException
 */
private int writeBufferToSocket(@NotNull final SocketChannel socketChannel,final long approxTime) throws IOException {
  if (in.position() == 0)   return 0;
  lastSentTime=approxTime;
  out.limit((int)in.position());
  final int len=socketChannel.write(out);
  if (LOG.isDebugEnabled())   LOG.debug("String_Node_Str" + len);
  if (out.remaining() == 0) {
    out.clear();
    in.clear();
  }
 else {
    out.compact();
    in.position(out.position());
    in.limit(in.capacity());
    out.clear();
  }
  return len;
}

Fixed version (ground truth):
/** 
 * writes the contents of the buffer to the socket
 * @param socketChannel the socket to publish the buffer to
 * @param approxTime    an approximation of the current time in millis
 * @throws IOException
 */
private int writeBufferToSocket(@NotNull final SocketChannel socketChannel,final long approxTime) throws IOException {
  if (in.position() == 0)   return 0;
  lastSentTime=approxTime;
  int size=(int)in.position();
  out.limit(size);
  final int len=socketChannel.write(out);
  if (LOG.isDebugEnabled())   LOG.debug("String_Node_Str" + len);
  if (len == size) {
    out.clear();
    in.clear();
  }
 else {
    out.compact();
    in.position(out.position());
    in.limit(in.capacity());
    out.clear();
  }
  return len;
}
Program: 163038
Project: 163038
Buggy source:
@Test public void testBufferOverFlowPutAllAndEntrySet() throws IOException, InterruptedException {
  final ChronicleMap<Integer,CharSequence> serverMap;
  final ChronicleMap<Integer,CharSequence> statelessMap;
{
    statelessMap=ChronicleMapBuilder.of(Integer.class,CharSequence.class).stateless(remoteAddress(new InetSocketAddress("String_Node_Str",8076))).create();
  }
{
    serverMap=ChronicleMapBuilder.of(Integer.class,CharSequence.class).replicators((byte)2,TcpReplicationConfig.of(8076)).create();
  }
  Map<Integer,CharSequence> payload=new HashMap<Integer,CharSequence>();
  for (int i=0; i < SIZE; i++) {
    payload.put(i,"String_Node_Str" + i);
  }
  statelessMap.putAll(payload);
  Set<Map.Entry<Integer,CharSequence>> entries=statelessMap.entrySet();
  Map.Entry<Integer,CharSequence> next=entries.iterator().next();
  Assert.assertEquals("String_Node_Str" + next.getKey(),next.getValue());
  serverMap.close();
  statelessMap.close();
}

Fixed version (ground truth):
@Test public void testBufferOverFlowPutAllAndEntrySet() throws IOException, InterruptedException {
  final ChronicleMap<Integer,CharSequence> serverMap;
  final ChronicleMap<Integer,CharSequence> statelessMap;
{
    statelessMap=ChronicleMapBuilder.of(Integer.class,CharSequence.class).stateless(remoteAddress(new InetSocketAddress("String_Node_Str",8076))).create();
  }
{
    serverMap=ChronicleMapBuilder.of(Integer.class,CharSequence.class).replicators((byte)2,TcpReplicationConfig.of(8076)).create();
  }
  Map<Integer,CharSequence> payload=new HashMap<Integer,CharSequence>();
  for (int i=0; i < SIZE; i++) {
    payload.put(i,"String_Node_Str" + i);
  }
  statelessMap.putAll(payload);
  Set<Map.Entry<Integer,CharSequence>> entries=statelessMap.entrySet();
  Map.Entry<Integer,CharSequence> next=entries.iterator().next();
  Assert.assertEquals("String_Node_Str" + next.getKey(),next.getValue());
  Assert.assertEquals(entries.size(),SIZE);
  serverMap.close();
  statelessMap.close();
}
Program: 163039
Project: 163039
Buggy source:
ChronicleSetBuilder(Class<E> keyClass){
  chronicleMapBuilder=ChronicleMapBuilder.of(keyClass,DummyValue.class).entryAndValueAlignment(Alignment.NO_ALIGNMENT).valueMarshaller(DummyValueMarshaller.INSTANCE);
}

Fixed version (ground truth):
ChronicleSetBuilder(Class<E> keyClass){
  chronicleMapBuilder=ChronicleMapBuilder.of(keyClass,DummyValue.class).valueMarshaller(DummyValueMarshaller.INSTANCE);
}
Program: 163040
Project: 163040
Buggy source:
private void updateNextPosToSearchFrom(long allocated,int blocks){
  if ((nextPosToSearchFrom=allocated + blocks) >= freeList.size())   nextPosToSearchFrom=0L;
}

Fixed version (ground truth):
private void updateNextPosToSearchFrom(long allocated,int blocks){
  if ((nextPosToSearchFrom=allocated + blocks) >= entriesPerSegment)   nextPosToSearchFrom=0L;
}
Program: 163041
Project: 163041
Buggy source:
long alloc(int blocks){
  if (blocks > MAX_ENTRY_OVERSIZE_FACTOR)   throw new IllegalArgumentException("String_Node_Str" + blocks + "String_Node_Str"+ MAX_ENTRY_OVERSIZE_FACTOR+ "String_Node_Str");
  long ret=freeList.setNextNContinuousClearBits(nextPosToSearchFrom,blocks);
  if (ret == DirectBitSet.NOT_FOUND) {
    ret=freeList.setNextNContinuousClearBits(0L,blocks);
    if (ret == DirectBitSet.NOT_FOUND) {
      if (blocks == 1) {
        throw new IllegalStateException("String_Node_Str");
      }
 else {
        throw new IllegalStateException("String_Node_Str" + blocks + "String_Node_Str");
      }
    }
    updateNextPosToSearchFrom(ret,blocks);
  }
 else {
    if (blocks == 1 || freeList.isSet(nextPosToSearchFrom)) {
      updateNextPosToSearchFrom(ret,blocks);
    }
  }
  return ret;
}

Fixed version (ground truth):
long alloc(int blocks){
  if (blocks > MAX_ENTRY_OVERSIZE_FACTOR)   throw new IllegalArgumentException("String_Node_Str" + blocks + "String_Node_Str"+ MAX_ENTRY_OVERSIZE_FACTOR+ "String_Node_Str");
  long ret=freeList.setNextNContinuousClearBits(nextPosToSearchFrom,blocks);
  if (ret == DirectBitSet.NOT_FOUND || ret + blocks > entriesPerSegment) {
    if (ret + blocks > entriesPerSegment)     freeList.clear(ret,ret + blocks);
    ret=freeList.setNextNContinuousClearBits(0L,blocks);
    if (ret == DirectBitSet.NOT_FOUND || ret + blocks > entriesPerSegment) {
      if (ret + blocks > entriesPerSegment)       freeList.clear(ret,ret + blocks);
      if (blocks == 1) {
        throw new IllegalStateException("String_Node_Str");
      }
 else {
        throw new IllegalStateException("String_Node_Str" + blocks + "String_Node_Str");
      }
    }
    updateNextPosToSearchFrom(ret,blocks);
  }
 else {
    if (blocks == 1 || freeList.isSet(nextPosToSearchFrom)) {
      updateNextPosToSearchFrom(ret,blocks);
    }
  }
  return ret;
}
Program: 163042
Project: 163042
Buggy source:
/** 
 * Returns the file this hash container mapped to, i. e. when it is created by  {@link ChronicleHashBuilder#create()} call, or {@code null} if it is purely in-memory,i. e. if it is created by  {@link ChronicleHashBuilder#create()} call.
 * @return the file this {@link ChronicleMap} or {@link ChronicleSet} is mapped to,or  {@code null} if it is not mapped to any file
 * @see ChronicleHashBuilder#create(File)
 * @see ChronicleHashBuilder#create()
 */
File file();

Fixed version (ground truth):
/** 
 * Returns the file this hash container mapped to, i. e. when it is created by  {@link ChronicleHashBuilder#create()} call, or {@code null} if it is purely in-memory,i. e. if it is created by  {@link ChronicleHashBuilder#create()} call.
 * @return the file this {@link ChronicleMap} or {@link ChronicleSet} is mapped to,or  {@code null} if it is not mapped to any file
 * @see ChronicleHashBuilder#file(java.io.File)
 * @see ChronicleHashBuilder#create()
 */
File file();
Program: 163043
Project: 163043
Buggy source:
/** 
 * Specifies that hash containers us the specified file, if create is called and this is not set the map will be created in off-heap memory, and changes will not be persisted to disk. If a file is provided all  changes to the map are  persisted to disk (this is an operating system guarantee) independently from JVM process lifecycle.
 * @param file the file with existing hash container or a desired location of a new off-heappersisted hash container
 * @return this builder back
 * @see ChronicleHash#file()
 * @see ChronicleHash#close()
 */
B file(File file) throws IOException ;

Fixed version (ground truth):
/** 
 * Specifies that hash containers us the specified file, if create is called and this is not set the map will be created in off-heap memory, and changes will not be persisted to disk. If a file is provided all  changes to the map are  persisted to disk (this is an operating system guarantee) independently from JVM process lifecycle.
 * @param file the file with existing hash container or a desired location of a new off-heappersisted hash container
 * @return this builder back
 * @throws IOException If the file cannot be created and read.
 * @see ChronicleHash#file()
 * @see ChronicleHash#close()
 */
B file(File file) throws IOException ;
Program: 163044
Project: 163044
Buggy source:
/** 
 * Returns a replicator, dedicated to the specified channel. Channel is basically just a number, that should correspond on different servers for instances of the same replicated map. Only one replicator per channel could be obtained from a single   {@code ReplicatingChannel}. The returned replicator could be applied to a map at most once.
 * @return a replicator, dedicated to the specified channel
 */
public ChronicleChannel createChannel(short channel){
  return new ChronicleChannel(channel);
}

Fixed version (ground truth):
/** 
 * Returns a replicator, dedicated to the specified channel. Channel is basically just a number, that should correspond on different servers for instances of the same replicated map. Only one replicator per channel could be obtained from a single   {@code ReplicatingChannel}. The returned replicator could be applied to a map at most once.
 * @param channel number to create
 * @return a replicator, dedicated to the specified channel
 */
public ChronicleChannel createChannel(short channel){
  return new ChronicleChannel(channel);
}
Program: 163045
Project: 163045
Buggy source:
/** 
 * Specifies the value to be put for each key queried in   {@link ChronicleMap#get get()} and{@link ChronicleMap#getUsing(Object,Object) getUsing()} methods, if the key is absent in themap. Then this default value is returned from query method. <p/> <p>Setting default value to  {@code null} is interpreted as map shouldn't put any defaultvalue for absent keys. This is by default. <p/> <p>This configuration overrides any previous  {@link #defaultValueProvider(DefaultValueProvider)}configuration to this   {@code ChronicleMapBuilder}.
 * @param defaultValue the default value to be put to the map for absent keys during {@code get()} and {@code getUsing()} calls and returned from these calls
 * @return this builder object back
 */
public ChronicleMapBuilder<K,V> defaultValue(V defaultValue){
  this.defaultValue=defaultValue;
  this.defaultValueProvider=null;
  return this;
}

Fixed version (ground truth):
/** 
 * Specifies the value to be put for each key queried in   {@link ChronicleMap#get get()} and{@link ChronicleMap#getUsing(Object,Object) getUsing()} methods, if the key is absent in themap. Then this default value is returned from query method. <p>Setting default value to  {@code null} is interpreted as map shouldn't put any defaultvalue for absent keys. This is by default. <p>This configuration overrides any previous  {@link #defaultValueProvider(DefaultValueProvider)}configuration to this   {@code ChronicleMapBuilder}.
 * @param defaultValue the default value to be put to the map for absent keys during {@code get()} and {@code getUsing()} calls and returned from these calls
 * @return this builder object back
 */
public ChronicleMapBuilder<K,V> defaultValue(V defaultValue){
  this.defaultValue=defaultValue;
  this.defaultValueProvider=null;
  return this;
}
Program: 163046
Project: 163046
Buggy source:
/** 
 * {@inheritDoc}<p/> <p>Example:
 */
@Override public ChronicleMapBuilder<K,V> keyMarshaller(@NotNull BytesMarshaller<K> keyMarshaller){
  keyBuilder.marshaller(keyMarshaller,null);
  return this;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}<p>Example:
 */
@Override public ChronicleMapBuilder<K,V> keyMarshaller(@NotNull BytesMarshaller<K> keyMarshaller){
  keyBuilder.marshaller(keyMarshaller,null);
  return this;
}
Program: 163047
Project: 163047
Buggy source:
/** 
 * Configures the constant number of bytes, taken by serialized form of values, put into maps, created by this builder. This is done by providing the   {@code sampleValue}, all values should take the same number of bytes in serialized form, as this sample object. <p/> <p>If values are of boxed primitive type or   {@link Byteable} subclass, i. e. if value size isknown statically, it is automatically accounted and this method shouldn't be called. <p/> <p>If value size varies, method  {@link #valueSize(int)} or {@link #entrySize(int)} should becalled instead of this one.
 * @param sampleValue the sample value
 * @return this builder back
 * @see #valueSize(int)
 * @see #constantKeySizeBySample(Object)
 */
public ChronicleMapBuilder<K,V> constantValueSizeBySample(V sampleValue){
  this.sampleValue=sampleValue;
  return this;
}

Fixed version (ground truth):
/** 
 * Configures the constant number of bytes, taken by serialized form of values, put into maps, created by this builder. This is done by providing the   {@code sampleValue}, all values should take the same number of bytes in serialized form, as this sample object. <p>If values are of boxed primitive type or   {@link Byteable} subclass, i. e. if value size isknown statically, it is automatically accounted and this method shouldn't be called. <p>If value size varies, method  {@link #valueSize(int)} or {@link #entrySize(int)} should becalled instead of this one.
 * @param sampleValue the sample value
 * @return this builder back
 * @see #valueSize(int)
 * @see #constantKeySizeBySample(Object)
 */
public ChronicleMapBuilder<K,V> constantValueSizeBySample(V sampleValue){
  this.sampleValue=sampleValue;
  return this;
}
Program: 163048
Project: 163048
Buggy source:
/** 
 * {@inheritDoc}<p/> <p>For example, if your keys are Git commit hashes:<pre>  {@code Map<byte[], String> gitCommitMessagesByHash = ChronicleMapBuilder.of(byte[].class, String.class) .constantKeySizeBySample(new byte[20]) .create();}</pre>
 * @see #keySize(int)
 * @see #constantValueSizeBySample(Object)
 */
@Override public ChronicleMapBuilder<K,V> constantKeySizeBySample(K sampleKey){
  this.sampleKey=sampleKey;
  return this;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}<p>For example, if your keys are Git commit hashes:<pre>  {@code Map<byte[], String> gitCommitMessagesByHash = ChronicleMapBuilder.of(byte[].class, String.class) .constantKeySizeBySample(new byte[20]) .create();}</pre>
 * @see #keySize(int)
 * @see #constantValueSizeBySample(Object)
 */
@Override public ChronicleMapBuilder<K,V> constantKeySizeBySample(K sampleKey){
  this.sampleKey=sampleKey;
  return this;
}
Program: 163049
Project: 163049
Buggy source:
/** 
 * {@inheritDoc}<p/> <p>Example: <pre>  {@code Map<Key, Value> map =ChronicleMapBuilder.of(Key.class, Value.class) .entries(1_000_000) .keySize(50).valueSize(200) // this class hasn't implemented yet, just for example .objectSerializer(new KryoObjectSerializer()) .create();}</pre> <p/> <p>This serializer is used to serialize both keys and values, if they both require this: loosely typed, nullable, and custom   {@linkplain #keyMarshaller(BytesMarshaller) key} and{@linkplain #valueMarshallerAndFactory(BytesMarshaller,ObjectFactory) value} marshallers arenot configured.
 */
@Override public ChronicleMapBuilder<K,V> objectSerializer(ObjectSerializer objectSerializer){
  this.objectSerializer=objectSerializer;
  return this;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}<p>Example: <pre>  {@code Map<Key, Value> map =ChronicleMapBuilder.of(Key.class, Value.class) .entries(1_000_000) .keySize(50).valueSize(200) // this class hasn't implemented yet, just for example .objectSerializer(new KryoObjectSerializer()) .create();}</pre> <p>This serializer is used to serialize both keys and values, if they both require this: loosely typed, nullable, and custom   {@linkplain #keyMarshaller(BytesMarshaller) key} and{@linkplain #valueMarshallerAndFactory(BytesMarshaller,ObjectFactory) value} marshallers arenot configured.
 */
@Override public ChronicleMapBuilder<K,V> objectSerializer(ObjectSerializer objectSerializer){
  this.objectSerializer=objectSerializer;
  return this;
}
Program: 163050
Project: 163050
Buggy source:
/** 
 * Returns the timestamp of the last change from the specified remote node, already replicated to this Replica. <p/> <p>Used in conjunction with replication, to back fill data from a remote node. This node may have missed updates while it was not been running or connected via TCP.
 * @param remoteIdentifier the identifier of the remote node to check last replicated update time from
 * @return a timestamp of the last modification to an entry, or 0 if there are no entries.
 * @see #identifier()
 */
long lastModificationTime(byte remoteIdentifier);

Fixed version (ground truth):
/** 
 * Returns the timestamp of the last change from the specified remote node, already replicated to this Replica.  <p>Used in conjunction with replication, to back fill data from a remote node. This node may have missed updates while it was not been running or connected via TCP.
 * @param remoteIdentifier the identifier of the remote node to check last replicated update time from
 * @return a timestamp of the last modification to an entry, or 0 if there are no entries.
 * @see #identifier()
 */
long lastModificationTime(byte remoteIdentifier);
Program: 163051
Project: 163051
Buggy source:
/** 
 * Dirties all entries with a modification time equal to   {@code fromTimeStamp} or newer. It means allthese entries will be considered as "new" by this ModificationIterator and iterated once again no matter if they have already been. <p/> <p>This functionality is used to publish recently modified entries to a new remote node as it connects.
 * @param fromTimeStamp the timestamp from which all entries should be dirty
 */
void dirtyEntries(long fromTimeStamp);

Fixed version (ground truth):
/** 
 * Dirties all entries with a modification time equal to   {@code fromTimeStamp} or newer. It means allthese entries will be considered as "new" by this ModificationIterator and iterated once again no matter if they have already been.  <p>This functionality is used to publish recently modified entries to a new remote node as it connects.
 * @param fromTimeStamp the timestamp from which all entries should be dirty
 */
void dirtyEntries(long fromTimeStamp);
Program: 163052
Project: 163052
Buggy source:
/** 
 * Used only with replication, its sometimes possible to receive an old ( or stale update ) from a remote map. This method is used to determine if we should ignore such updates. <p/> <p>We can reject put() and removes() when comparing times stamps with remote systems
 * @param entry      the maps entry
 * @param timestamp  the time the entry was created or updated
 * @param identifier the unique identifier relating to this map
 * @return true if the entry should not be processed
 */
private boolean shouldIgnore(@NotNull final NativeBytes entry,final long timestamp,final byte identifier){
  final long lastModifiedTimeStamp=entry.readLong();
  if (lastModifiedTimeStamp < timestamp) {
    entry.skip(1);
    return false;
  }
  if (lastModifiedTimeStamp > timestamp)   return true;
  return entry.readByte() > identifier;
}

Fixed version (ground truth):
/** 
 * Used only with replication, its sometimes possible to receive an old ( or stale update ) from a remote map. This method is used to determine if we should ignore such updates. <p>We can reject put() and removes() when comparing times stamps with remote systems
 * @param entry      the maps entry
 * @param timestamp  the time the entry was created or updated
 * @param identifier the unique identifier relating to this map
 * @return true if the entry should not be processed
 */
private boolean shouldIgnore(@NotNull final NativeBytes entry,final long timestamp,final byte identifier){
  final long lastModifiedTimeStamp=entry.readLong();
  if (lastModifiedTimeStamp < timestamp) {
    entry.skip(1);
    return false;
  }
  if (lastModifiedTimeStamp > timestamp)   return true;
  return entry.readByte() > identifier;
}
Program: 163053
Project: 163053
Buggy source:
void preMapConstruction(){
  keyBuilder.objectSerializer(objectSerializer());
  valueBuilder.objectSerializer(objectSerializer());
  int maxSize=entrySize() * figureBufferAllocationFactor();
  keyBuilder.maxSize(maxSize);
  valueBuilder.maxSize(maxSize);
  if (sampleKey != null)   keyBuilder.constantSizeBySample(sampleKey);
  if (sampleValue != null)   valueBuilder.constantSizeBySample(sampleValue);
}

Fixed version (ground truth):
void preMapConstruction(){
  keyBuilder.objectSerializer(objectSerializer());
  valueBuilder.objectSerializer(objectSerializer());
  long maxSize=(long)entrySize() * figureBufferAllocationFactor();
  keyBuilder.maxSize(maxSize);
  valueBuilder.maxSize(maxSize);
  if (sampleKey != null)   keyBuilder.constantSizeBySample(sampleKey);
  if (sampleValue != null)   valueBuilder.constantSizeBySample(sampleValue);
}
Program: 163054
Project: 163054
Buggy source:
int alloc(int blocks){
  if (blocks > MAX_ENTRY_OVERSIZE_FACTOR)   throw new IllegalArgumentException("String_Node_Str" + blocks + "String_Node_Str"+ MAX_ENTRY_OVERSIZE_FACTOR+ "String_Node_Str");
  int ret=(int)freeList.setNextNContinuousClearBits(nextPosToSearchFrom,blocks);
  if (ret == DirectBitSet.NOT_FOUND) {
    ret=(int)freeList.setNextNContinuousClearBits(0,blocks);
    if (ret == DirectBitSet.NOT_FOUND) {
      if (blocks == 1) {
        throw new IllegalArgumentException("String_Node_Str");
      }
 else {
        throw new IllegalArgumentException("String_Node_Str" + blocks + "String_Node_Str");
      }
    }
  }
  if (blocks == 1 || freeList.isSet(nextPosToSearchFrom))   nextPosToSearchFrom=ret + blocks;
  return ret;
}

Fixed version (ground truth):
int alloc(int blocks){
  if (blocks > MAX_ENTRY_OVERSIZE_FACTOR)   throw new IllegalArgumentException("String_Node_Str" + blocks + "String_Node_Str"+ MAX_ENTRY_OVERSIZE_FACTOR+ "String_Node_Str");
  int ret=(int)freeList.setNextNContinuousClearBits(nextPosToSearchFrom,blocks);
  if (ret == DirectBitSet.NOT_FOUND) {
    ret=(int)freeList.setNextNContinuousClearBits(0,blocks);
    if (ret == DirectBitSet.NOT_FOUND) {
      if (blocks == 1) {
        throw new IllegalArgumentException("String_Node_Str");
      }
 else {
        throw new IllegalArgumentException("String_Node_Str" + blocks + "String_Node_Str");
      }
    }
    updateNextPosToSearchFrom(ret,blocks);
  }
 else {
    if (blocks == 1 || freeList.isSet(nextPosToSearchFrom)) {
      updateNextPosToSearchFrom(ret,blocks);
    }
  }
  return ret;
}
Program: 163055
Project: 163055
Buggy source:
public VanillaChronicleMap(ChronicleMapBuilder<K,V> builder) throws IOException {
  SerializationBuilder<K> keyBuilder=builder.keyBuilder;
  kClass=keyBuilder.eClass;
  keySizeMarshaller=keyBuilder.sizeMarshaller();
  originalKeyReader=keyBuilder.reader();
  originalKeyInterop=(KI)keyBuilder.interop();
  originalMetaKeyInterop=(MKI)keyBuilder.metaInterop();
  metaKeyInteropProvider=(MetaProvider<K,KI,MKI>)keyBuilder.metaInteropProvider();
  SerializationBuilder<V> valueBuilder=builder.valueBuilder;
  vClass=valueBuilder.eClass;
  valueSizeMarshaller=valueBuilder.sizeMarshaller();
  originalValueReader=valueBuilder.reader();
  originalValueWriter=(VW)valueBuilder.interop();
  originalMetaValueWriter=(MVW)valueBuilder.metaInterop();
  metaValueWriterProvider=(MetaProvider)valueBuilder.metaInteropProvider();
  valueFactory=valueBuilder.factory();
  defaultValueProvider=builder.defaultValueProvider();
  lockTimeOutNS=builder.lockTimeOut(TimeUnit.NANOSECONDS);
  this.entrySize=builder.entrySize();
  this.alignment=builder.entryAndValueAlignment();
  this.errorListener=builder.errorListener();
  this.putReturnsNull=builder.putReturnsNull();
  this.removeReturnsNull=builder.removeReturnsNull();
  this.actualSegments=builder.actualSegments();
  this.entriesPerSegment=builder.actualEntriesPerSegment();
  this.metaDataBytes=builder.metaDataBytes();
  this.eventListener=builder.eventListener();
  this.mask=useSmallMultiMaps() ? 0xFFFF : ~0;
  this.bits=Maths.intLog2(actualSegments);
  initTransients();
}

Fixed version (ground truth):
public VanillaChronicleMap(ChronicleMapBuilder<K,V> builder) throws IOException {
  SerializationBuilder<K> keyBuilder=builder.keyBuilder;
  kClass=keyBuilder.eClass;
  keySizeMarshaller=keyBuilder.sizeMarshaller();
  originalKeyReader=keyBuilder.reader();
  originalKeyInterop=(KI)keyBuilder.interop();
  originalMetaKeyInterop=(MKI)keyBuilder.metaInterop();
  metaKeyInteropProvider=(MetaProvider<K,KI,MKI>)keyBuilder.metaInteropProvider();
  SerializationBuilder<V> valueBuilder=builder.valueBuilder;
  vClass=valueBuilder.eClass;
  valueSizeMarshaller=valueBuilder.sizeMarshaller();
  originalValueReader=valueBuilder.reader();
  originalValueWriter=(VW)valueBuilder.interop();
  originalMetaValueWriter=(MVW)valueBuilder.metaInterop();
  metaValueWriterProvider=(MetaProvider)valueBuilder.metaInteropProvider();
  valueFactory=valueBuilder.factory();
  defaultValueProvider=builder.defaultValueProvider();
  lockTimeOutNS=builder.lockTimeOut(TimeUnit.NANOSECONDS);
  this.entrySize=builder.entrySize();
  this.alignment=builder.entryAndValueAlignment();
  this.errorListener=builder.errorListener();
  this.putReturnsNull=builder.putReturnsNull();
  this.removeReturnsNull=builder.removeReturnsNull();
  this.actualSegments=builder.actualSegments();
  this.entriesPerSegment=align8(builder.actualEntriesPerSegment());
  this.metaDataBytes=builder.metaDataBytes();
  this.eventListener=builder.eventListener();
  this.mask=useSmallMultiMaps() ? 0xFFFF : ~0;
  this.bits=Maths.intLog2(actualSegments);
  initTransients();
}
Program: 163057
Project: 163057
Buggy source:
/** 
 * Specifies the value to be put for each key queried in   {@link ChronicleMap#get get()} and{@link ChronicleMap#getUsing(Object,Object) getUsing()} methods, if the key is absentin the map. Then this default value is returned from query method. <p>Setting default value to  {@code null} is interpreted as map shouldn't put any defaultvalue for absent keys. This is by default. <p>This configuration overrides any previous {@link #defaultValueProvider(DefaultValueProvider)} configuration to this{@code ChronicleMapBuilder}.
 * @param defaultValue the default value to be put to the map for absent keys during{@code get()} and {@code getUsing()} calls and returned from these calls
 * @return this builder object back
 */
public ChronicleMapBuilder<K,V> defaultValue(V defaultValue){
  this.defaultValue=defaultValue;
  this.defaultValueProvider=null;
  return this;
}

Fixed version (ground truth):
/** 
 * Specifies the value to be put for each key queried in   {@link ChronicleMap#get get()} and {@link ChronicleMap#getUsing(Object,Object) getUsing()} methods, if the key is absent in the map. Then thisdefault value is returned from query method. <p>Setting default value to  {@code null} is interpreted as map shouldn't put any default value forabsent keys. This is by default. <p>This configuration overrides any previous  {@link #defaultValueProvider(DefaultValueProvider)}configuration to this   {@code ChronicleMapBuilder}.
 * @param defaultValue the default value to be put to the map for absent keys during {@code get()} and{@code getUsing()} calls and returned from these calls
 * @return this builder object back
 */
public ChronicleMapBuilder<K,V> defaultValue(V defaultValue){
  this.defaultValue=defaultValue;
  this.defaultValueProvider=null;
  return this;
}
Program: 163058
Project: 163058
Buggy source:
/** 
 * Configures the constant number of bytes, taken by serialized form of values, put into maps, created by this builder. This is done by providing the   {@code sampleValue}, all values should take the same number of bytes in serialized form, as this sample object. <p>If values are of boxed primitive type or   {@link Byteable} subclass, i. e. if value sizeis known statically, it is automatically accounted and this method shouldn't be called. <p>If value size varies, method  {@link #valueSize(int)} or {@link #entrySize(int)} should becalled instead of this one.
 * @param sampleValue the sample value
 * @return this builder back
 * @see #valueSize(int)
 * @see #constantKeySizeBySample(Object)
 */
public ChronicleMapBuilder<K,V> constantValueSizeBySample(V sampleValue){
  this.sampleValue=sampleValue;
  return this;
}

Fixed version (ground truth):
/** 
 * Configures the constant number of bytes, taken by serialized form of values, put into maps, created by this builder. This is done by providing the   {@code sampleValue}, all values should take the same number of bytes in serialized form, as this sample object. <p>If values are of boxed primitive type or   {@link Byteable} subclass, i. e. if value size is knownstatically, it is automatically accounted and this method shouldn't be called. <p>If value size varies, method  {@link #valueSize(int)} or {@link #entrySize(int)} should be calledinstead of this one.
 * @param sampleValue the sample value
 * @return this builder back
 * @see #valueSize(int)
 * @see #constantKeySizeBySample(Object)
 */
public ChronicleMapBuilder<K,V> constantValueSizeBySample(V sampleValue){
  this.sampleValue=sampleValue;
  return this;
}
Program: 163059
Project: 163059
Buggy source:
@Override public boolean wasRemoved(@NotNull Bytes entry){
  final long start=entry.position();
  try {
    return entry.readBoolean(keySizeMarshaller.readSize(entry) + 10);
  }
  finally {
    entry.position(start);
  }
}

Fixed version (ground truth):
@Override public boolean wasRemoved(@NotNull Bytes entry){
  final long start=entry.position();
  try {
    return entry.readBoolean(keySizeMarshaller.readSize(entry) + 9);
  }
  finally {
    entry.position(start);
  }
}
Program: 163060
Project: 163060
Buggy source:
WithCustomFactory(@NotNull Class<E> tClass,@NotNull ObjectFactory<E> factory){
  super(tClass);
  this.factory=factory;
}

Fixed version (ground truth):
WithCustomFactory(@NotNull Class<E> tClass,@NotNull ObjectFactory<E> factory){
  super(tClass);
  this.factory=factory;
  initSize();
}
Program: 163061
Project: 163061
Buggy source:
public static <E extends Byteable>ByteableMarshaller<E> of(@NotNull Class<E> eClass,ObjectFactory<E> factory){
  if (factory instanceof AllocateInstanceObjectFactory) {
    Class allocatedClass=((AllocateInstanceObjectFactory)factory).allocatedClass();
    return new ByteableMarshaller<E>(allocatedClass);
  }
 else {
    return new WithCustomFactory<E>(eClass,factory);
  }
}

Fixed version (ground truth):
public static <E extends Byteable>ByteableMarshaller<E> of(@NotNull Class<E> eClass,ObjectFactory<E> factory){
  if (factory instanceof AllocateInstanceObjectFactory) {
    Class allocatedClass=((AllocateInstanceObjectFactory)factory).allocatedClass();
    return new Default<E>(allocatedClass);
  }
 else {
    return new WithCustomFactory<E>(eClass,factory);
  }
}
Program: 163062
Project: 163062
Buggy source:
ByteableMarshaller(@NotNull Class<E> tClass){
  this.tClass=tClass;
  try {
    size=getInstance().maxSize();
  }
 catch (  Exception e) {
    throw new IllegalStateException(e);
  }
}

Fixed version (ground truth):
private ByteableMarshaller(@NotNull Class<E> tClass){
  this.tClass=tClass;
}
Program: 163064
Project: 163064
Buggy source:
/** 
 * sets up a 2 clusters ( notionally one for each host ), and replicates 2 Chronicle Maps between them
 * @throws IOException
 * @throws InterruptedException
 */
@Test public void test() throws IOException, InterruptedException {
  map2a.put(1,"String_Node_Str");
  map1a.put(1,"String_Node_Str");
  waitTillEqual(2500);
  Assert.assertEquals("String_Node_Str",map1a,map1b);
  Assert.assertEquals("String_Node_Str",map2a,map2b);
  assertTrue("String_Node_Str",!map1a.isEmpty());
  assertTrue("String_Node_Str",!map2a.isEmpty());
}

Fixed version (ground truth):
/** 
 * sets up a 2 clusters ( notionally one for each host ), and replicates 2 Chronicle Maps between them
 * @throws IOException
 * @throws InterruptedException
 */
@Test @Ignore public void test() throws IOException, InterruptedException {
  map2a.put(1,"String_Node_Str");
  map1a.put(1,"String_Node_Str");
  waitTillEqual(2500);
  Assert.assertEquals("String_Node_Str",map1a,map1b);
  Assert.assertEquals("String_Node_Str",map2a,map2b);
  assertTrue("String_Node_Str",!map1a.isEmpty());
  assertTrue("String_Node_Str",!map2a.isEmpty());
}