nus-yam/ex-repair huggingface dataset:
Program: 19269
Project: 19269
Buggy source:
public SOSObservationOffering(){
  setObservationStationID("String_Node_Str");
  setObservationStationDescription("String_Node_Str");
  setObservationName("String_Node_Str");
  setObservationSrsName("String_Node_Str");
  setObservationStationLowerCorner("String_Node_Str","String_Node_Str");
  setObservationStationUpperCorner("String_Node_Str","String_Node_Str");
  setObservationTimeBegin("String_Node_Str");
  setObservationTimeEnd("String_Node_Str");
  setObservationProcedureLink("String_Node_Str");
  setObservationObservedProperty("String_Node_Str");
  setObservationFeatureOfInterest("String_Node_Str");
  setObservationFormat("String_Node_Str");
  setObservationModel("String_Node_Str");
  setObservationResponseMode("String_Node_Str");
}

Fixed version (ground truth):
public SOSObservationOffering(){
  setObservationStationID("String_Node_Str");
  setObservationStationDescription("String_Node_Str");
  setObservationName("String_Node_Str");
  setObservationSrsName("String_Node_Str");
  setObservationStationLowerCorner("String_Node_Str","String_Node_Str");
  setObservationStationUpperCorner("String_Node_Str","String_Node_Str");
  setObservationTimeBegin("String_Node_Str");
  setObservationTimeEnd("String_Node_Str");
  setObservationProcedureLink("String_Node_Str");
  setObservationObservedProperty("String_Node_Str");
  setObservationFeatureOfInterest("String_Node_Str");
  setObservationModel("String_Node_Str");
  setObservationResponseMode("String_Node_Str");
}
Program: 19272
Project: 19272
Buggy source:
public StationTimeSeriesFeatureCollection getFeatureCollection(){
  return featureCollection;
}

Fixed version (ground truth):
@Deprecated public StationTimeSeriesFeatureCollection getFeatureCollection(){
  return featureCollection;
}
Program: 19273
Project: 19273
Buggy source:
public ProfileFeatureCollection getProfileFeatureCollection(){
  return ProfileFeatureCollection;
}

Fixed version (ground truth):
@Deprecated public ProfileFeatureCollection getProfileFeatureCollection(){
  return ProfileFeatureCollection;
}
Program: 19274
Project: 19274
Buggy source:
public StationProfileFeatureCollection getFeatureProfileCollection(){
  return featureCollectionProfileFeature;
}

Fixed version (ground truth):
@Deprecated public StationProfileFeatureCollection getFeatureProfileCollection(){
  return featureCollectionProfileFeature;
}
Program: 19275
Project: 19275
Buggy source:
public static StationTimeSeriesFeatureCollection extractStationTimeSeriesFeatureCollection(FeatureDataset featureDataset) throws IOException {
  if (featureDataset instanceof FeatureDatasetPoint) {
    FeatureDatasetPoint featureDatasetPoint=(FeatureDatasetPoint)featureDataset;
    List<FeatureCollection> featureCollectionList=featureDatasetPoint.getPointFeatureCollectionList();
    if (featureCollectionList != null && featureCollectionList.size() > 0) {
      if (featureCollectionList.size() == 1) {
        FeatureCollection featureCollection=featureCollectionList.get(0);
        if (featureCollection instanceof StationTimeSeriesFeatureCollection) {
          return (StationTimeSeriesFeatureCollection)featureCollection;
        }
 else         if (featureCollection instanceof StationProfileFeatureCollection) {
        }
 else         if (featureCollection instanceof StationPointFeature) {
        }
 else         if (featureCollection instanceof StationProfileFeature) {
        }
 else         if (featureCollection instanceof StationTimeSeriesFeature) {
        }
 else         if (featureCollection instanceof ProfileFeature) {
        }
 else         if (featureCollection instanceof ProfileFeatureCollection) {
        }
      }
 else {
      }
    }
 else {
    }
  }
 else {
  }
  return null;
}

Fixed version (ground truth):
public static StationTimeSeriesFeatureCollection extractStationTimeSeriesFeatureCollection(FeatureDataset featureDataset) throws IOException {
  if (featureDataset instanceof FeatureDatasetPoint) {
    FeatureDatasetPoint featureDatasetPoint=(FeatureDatasetPoint)featureDataset;
    List<FeatureCollection> featureCollectionList=featureDatasetPoint.getPointFeatureCollectionList();
    if (featureCollectionList != null && featureCollectionList.size() > 0) {
      if (featureCollectionList.size() == 1) {
        FeatureCollection featureCollection=featureCollectionList.get(0);
        if (featureCollection instanceof StationTimeSeriesFeatureCollection) {
          return (StationTimeSeriesFeatureCollection)featureCollection;
        }
 else         if (featureCollection instanceof StationProfileFeatureCollection) {
        }
 else         if (featureCollection instanceof StationPointFeature) {
        }
 else         if (featureCollection instanceof StationProfileFeature) {
        }
 else         if (featureCollection instanceof StationTimeSeriesFeature) {
        }
 else         if (featureCollection instanceof ProfileFeature) {
        }
 else         if (featureCollection instanceof ProfileFeatureCollection) {
        }
 else         if (featureCollection instanceof Grid) {
        }
 else         if (featureCollection instanceof TrajectoryFeature) {
        }
      }
 else {
      }
    }
 else {
    }
  }
 else {
  }
  return null;
}
Program: 19276
Project: 19276
Buggy source:
@Test public void testTemplateFileLocation() throws Exception {
  String location=getClass().getClassLoader().getResource("String_Node_Str").getPath();
  location=location.replaceAll("String_Node_Str","String_Node_Str");
  NetcdfDataset dataset=NetcdfDataset.openDataset(location);
  Extent ext=ThreddsExtentUtil.getExtent(dataset);
  DatasetMetaData dst=new DatasetMetaData(ext,dataset);
  dst.extractData();
  MockGetCapabilitiesParser MockGetCapP=new MockGetCapabilitiesParser(dst);
  fail("String_Node_Str");
  String templateFileLocation=getClass().getClassLoader().getResource("String_Node_Str").getPath();
  templateFileLocation=templateFileLocation.replaceAll("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testTemplateFileLocation() throws Exception {
  String location=getClass().getClassLoader().getResource("String_Node_Str").getPath();
  location=location.replaceAll("String_Node_Str","String_Node_Str");
  NetcdfDataset dataset=NetcdfDataset.openDataset(location);
  Extent ext=ThreddsExtentUtil.getExtent(dataset);
  DatasetMetaData dst=new DatasetMetaData(ext,dataset);
  dst.extractData();
  MockGetCapabilitiesParser MockGetCapP=new MockGetCapabilitiesParser(dst);
  String serverLocation=MockGetCapP.getTemplateLocation();
  String templateFileLocation=getClass().getClassLoader().getResource(serverLocation).getPath();
  templateFileLocation=templateFileLocation.replaceAll("String_Node_Str","String_Node_Str");
  assertTrue(templateFileLocation.contains("String_Node_Str"));
  assertTrue(MockGetCapP.getTemplateStream() != null);
}
Program: 19277
Project: 19277
Buggy source:
@Test public void testTemplateFileLocation() throws Exception {
  String location=getClass().getClassLoader().getResource("String_Node_Str").getPath();
  location=location.replaceAll("String_Node_Str","String_Node_Str");
  NetcdfDataset dataset=NetcdfDataset.openDataset(location);
  Extent ext=ThreddsExtentUtil.getExtent(dataset);
  DatasetMetaData dst=new DatasetMetaData(ext,dataset);
  dst.extractData();
  MockGetObservationParser MockGetObsP=new MockGetObservationParser(dst);
  fail("String_Node_Str");
  String templateFileLocation=getClass().getClassLoader().getResource("String_Node_Str").getPath();
  templateFileLocation=templateFileLocation.replaceAll("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testTemplateFileLocation() throws Exception {
  String location=getClass().getClassLoader().getResource("String_Node_Str").getPath();
  location=location.replaceAll("String_Node_Str","String_Node_Str");
  NetcdfDataset dataset=NetcdfDataset.openDataset(location);
  Extent ext=ThreddsExtentUtil.getExtent(dataset);
  DatasetMetaData dst=new DatasetMetaData(ext,dataset);
  dst.extractData();
  MockGetObservationParser MockGetObsP=new MockGetObservationParser(dst);
  String serverLocation=MockGetObsP.getTemplateLocation();
  String templateFileLocation=getClass().getClassLoader().getResource(serverLocation).getPath();
  templateFileLocation=templateFileLocation.replaceAll("String_Node_Str","String_Node_Str");
  assertTrue(templateFileLocation.contains("String_Node_Str"));
  assertTrue(MockGetObsP.getTemplateStream() != null);
}
Program: 19278
Project: 19278
Buggy source:
@Test public void testCheckProcedure() throws Exception {
  MockGetObservationParser MockGetObs=new MockGetObservationParser(getdst());
  MockGetObs.parseTemplateXML();
  String[] observedProperty={"String_Node_Str"};
  MockGetObs.parseObservations(observedProperty);
  String name=MockGetObs.getObservationProcedure();
  fail("String_Node_Str");
}

Fixed version (ground truth):
@Test public void testCheckProcedure() throws Exception {
  MockGetObservationParser MockGetObs=new MockGetObservationParser(getdst());
  MockGetObs.parseTemplateXML();
  String[] observedProperty={"String_Node_Str"};
  MockGetObs.parseObservations(observedProperty);
  String name=MockGetObs.getObservationProcedure();
  assertTrue(name.contains("String_Node_Str"));
}
Program: 19279
Project: 19279
Buggy source:
/** 
 * Enhance NCML with Data Discovery conventions elements if not already in place in the metadata.
 * @param dataset NetcdfDataset to enhance the NCML
 * @param writer writer to send enhanced NCML to
 */
public static void enhance(final NetcdfDataset dataset,final Writer writer,final String query){
  MockGetCapP=null;
  xmlString=null;
  EventTime=null;
  isMultiTime=false;
  isMultiObsProperties=false;
  Extent ext=null;
  try {
    ext=ThreddsExtentUtil.getExtent(dataset);
    DatasetMetaData dst=new DatasetMetaData(ext,dataset);
    dst.extractData();
    if (query != null) {
      splitQuery(query);
      if ((service != null) && (request != null) && (version != null)) {
        if (request.equalsIgnoreCase("String_Node_Str")) {
          createGetCapsResults(dst,writer);
        }
 else         if (request.equalsIgnoreCase("String_Node_Str")) {
        }
 else         if (request.equalsIgnoreCase("String_Node_Str")) {
          if (EventTime != null) {
            dst.setSearchTimes(EventTime,isMultiTime);
          }
          dst.setRequestedStationName(MetadataParser.offering);
          dst.setDatasetArrayValues(observedProperties);
          createGetObsResults(dst,writer);
        }
 else {
          writeErrorXMLCode(writer);
        }
      }
 else {
        writeErrorXMLCode(writer);
      }
    }
 else     if (query == null) {
      _log.info("String_Node_Str");
      createGetCapsResults(dst,writer);
    }
    dst.closeDataSet();
  }
 catch (  Exception e) {
    _log.error(e);
  }
}

Fixed version (ground truth):
/** 
 * Enhance NCML with Data Discovery conventions elements if not already in place in the metadata.
 * @param dataset NetcdfDataset to enhance the NCML
 * @param writer writer to send enhanced NCML to
 */
public static void enhance(final NetcdfDataset dataset,final Writer writer,final String query){
  MockGetCapP=null;
  xmlString=null;
  EventTime=null;
  isMultiTime=false;
  isMultiObsProperties=false;
  Extent ext=null;
  try {
    ext=ThreddsExtentUtil.getExtent(dataset);
    DatasetMetaData dst=new DatasetMetaData(ext,dataset);
    dst.extractData();
    if (query != null) {
      splitQuery(query);
      if ((service != null) && (request != null) && (version != null)) {
        if (request.equalsIgnoreCase("String_Node_Str")) {
          createGetCapsResults(dst,writer);
        }
 else         if (request.equalsIgnoreCase("String_Node_Str")) {
          writeErrorXMLCode(writer);
        }
 else         if (request.equalsIgnoreCase("String_Node_Str")) {
          if (EventTime != null) {
            dst.setSearchTimes(EventTime,isMultiTime);
          }
          dst.setRequestedStationName(MetadataParser.offering);
          dst.setDatasetArrayValues(observedProperties);
          createGetObsResults(dst,writer);
        }
 else {
          writeErrorXMLCode(writer);
        }
      }
 else {
        writeErrorXMLCode(writer);
      }
    }
 else     if (query == null) {
      _log.info("String_Node_Str");
      createGetCapsResults(dst,writer);
    }
    dst.closeDataSet();
  }
 catch (  Exception e) {
    _log.error(e);
  }
}
Program: 19280
Project: 19280
Buggy source:
/** 
 * Ensure that we and send a "ping" and receive a "pong" between a  {@link Client} and a {@link Server}.
 */
@Test public void shouldPingPong(){
  Server server=new Server(10000);
  server.addOperationHandler(new PingPong());
  try {
    server.open();
    Client client=new Client(server.getInetAddress(),10000);
    String result=client.invoke(new PingPong());
    assertThat(result,Matchers.equalTo("String_Node_Str"));
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
/** 
 * Ensure that we and send a "ping" and receive a "pong" between a  {@link Client} and a {@link Server}.
 */
@Test public void shouldPingPong(){
  Server server=new Server(10000);
  server.addOperationHandler(new PingPong());
  try {
    server.open();
    Client client=new Client(server.getInetAddress(),server.getPort());
    String result=client.invoke(new PingPong());
    assertThat(result,Matchers.equalTo("String_Node_Str"));
  }
 catch (  IOException e) {
  }
}
Program: 19281
Project: 19281
Buggy source:
/** 
 * Sets the expected type of keys and values for a   {@link Cache}configured with this   {@link Configuration}. Setting both to <code>Object.class</code> means type-safety checks are not required. <p/> This is used by   {@link javax.cache.CacheManager} to ensure that the key andvalue types are the same as those configured for the  {@link Cache} prior toreturning a requested cache from this method. <p/> Implementations may further perform type checking on mutative cache operations and throw a  {@link ClassCastException} if these checks fail.
 * @param keyType   the expected key type
 * @param valueType the expected value type
 * @return the {@link MutableConfiguration} to permit fluent-style method calls
 * @throws NullPointerException should the key or value type be null
 * @see javax.cache.CacheManager#getCache(String,Class,Class)
 */
public MutableBasicConfiguration<K,V> setTypes(Class<K> keyType,Class<V> valueType){
  if (keyType == null || valueType == null) {
    throw new NullPointerException("String_Node_Str");
  }
 else {
    this.keyType=keyType;
    this.valueType=valueType;
    return this;
  }
}

Fixed version (ground truth):
/** 
 * Sets the expected type of keys and values for a   {@link Cache}configured with this   {@link Configuration}. Setting both to <code>Object.class</code> means type-safety checks are not required. <p> This is used by   {@link javax.cache.CacheManager} to ensure that the key andvalue types are the same as those configured for the  {@link Cache} prior toreturning a requested cache from this method. </p> Implementations may further perform type checking on mutative cache operations and throw a  {@link ClassCastException} if these checks fail.
 * @param keyType   the expected key type
 * @param valueType the expected value type
 * @return the {@link MutableConfiguration} to permit fluent-style method calls
 * @throws NullPointerException should the key or value type be null
 * @see javax.cache.CacheManager#getCache(String,Class,Class)
 */
public MutableBasicConfiguration<K,V> setTypes(Class<K> keyType,Class<V> valueType){
  if (keyType == null || valueType == null) {
    throw new NullPointerException("String_Node_Str");
  }
 else {
    this.keyType=keyType;
    this.valueType=valueType;
    return this;
  }
}
Program: 19282
Project: 19282
Buggy source:
/** 
 * Multiple invocations of   {@link javax.cache.spi.CachingProvider#getCacheManager()}will return the same instance.
 */
@Test public void getCacheManagerSingleton(){
  CachingProvider provider=Caching.getCachingProvider();
  ClassLoader classLoader=Caching.getDefaultClassLoader();
  CacheManager manager=provider.getCacheManager();
  assertNotNull(provider);
  assertNotNull(classLoader);
  assertNotNull(manager);
  assertSame(manager,provider.getCacheManager(provider.getDefaultURI(),classLoader));
  ClassLoader otherLoader=new MyClassLoader(classLoader);
  CachingProvider otherProvider=Caching.getCachingProvider(otherLoader);
  assertNotSame(provider,otherProvider);
  CacheManager otherManager=otherProvider.getCacheManager();
  assertNotSame(manager,otherManager);
  assertSame(otherManager,otherProvider.getCacheManager());
  assertSame(otherManager,otherProvider.getCacheManager(otherProvider.getDefaultURI(),classLoader));
}

Fixed version (ground truth):
/** 
 * Multiple invocations of   {@link javax.cache.spi.CachingProvider#getCacheManager()}will return the same instance.
 */
@Test public void getCacheManagerSingleton(){
  CachingProvider provider=Caching.getCachingProvider();
  ClassLoader classLoader=Caching.getDefaultClassLoader();
  CacheManager manager=provider.getCacheManager();
  assertNotNull(classLoader);
  assertNotNull(manager);
  assertSame(manager,provider.getCacheManager());
  assertSame(manager,provider.getCacheManager(provider.getDefaultURI(),provider.getDefaultClassLoader()));
  ClassLoader otherLoader=new MyClassLoader(classLoader);
  CachingProvider otherProvider=Caching.getCachingProvider(otherLoader);
  CacheManager otherManager=otherProvider.getCacheManager();
  assertSame(otherManager,otherProvider.getCacheManager());
  assertSame(otherManager,otherProvider.getCacheManager(otherProvider.getDefaultURI(),otherProvider.getDefaultClassLoader()));
}
Program: 19283
Project: 19283
Buggy source:
/** 
 * Constructs a   {@link Client} that will auto connect to a {@link Server}on the specified port.
 * @param address the {@link InetAddress} on which the {@link Server}is accepting requests
 * @param port    the port on which the {@link Server} isis accepting requests
 * @throws IOException when the {@link Client} can't connect to the{@link Server}
 */
public Client(InetAddress address,int port) throws IOException {
  this.port=port;
  try {
    this.socket=new Socket(address,port);
  }
 catch (  IOException ioe) {
    throw new IOException("String_Node_Str" + address + "String_Node_Str"+ port,ioe);
  }
  this.oos=new ObjectOutputStream(socket.getOutputStream());
  this.ois=new ObjectInputStream(socket.getInputStream());
}

Fixed version (ground truth):
/** 
 * Constructs a   {@link Client} that will auto connect to a {@link Server}on the specified port.
 * @param address the {@link InetAddress} on which the {@link Server}is accepting requests
 * @param port    the port on which the {@link Server} isis accepting requests
 * @throws IOException when the {@link Client} can't connect to the{@link Server}
 */
public Client(InetAddress address,int port) throws IOException {
  Logger logger=Logger.getLogger(this.getClass().getName());
  this.port=port;
  try {
    logger.log(Level.FINE,"String_Node_Str" + this.getClass().getCanonicalName() + "String_Node_Str"+ address+ "String_Node_Str"+ port);
    this.socket=new Socket(address,port);
  }
 catch (  IOException ioe) {
    throw new IOException("String_Node_Str" + address + "String_Node_Str"+ port,ioe);
  }
  this.oos=new ObjectOutputStream(socket.getOutputStream());
  this.ois=new ObjectInputStream(socket.getInputStream());
}
Program: 19284
Project: 19284
Buggy source:
/** 
 * Get non-loopback address.  InetAddress.getLocalHost() does not work on machines without static ip address.
 * @param preferIPv4 true iff require IPv4 addresses only
 * @param preferIPv6 true iff prefer IPv6 addresses
 * @return nonLoopback {@link InetAddress}
 * @throws SocketException
 */
private static InetAddress getFirstNonLoopbackAddress(boolean preferIPv4,boolean preferIPv6) throws SocketException {
  Enumeration en=NetworkInterface.getNetworkInterfaces();
  while (en.hasMoreElements()) {
    NetworkInterface i=(NetworkInterface)en.nextElement();
    for (Enumeration en2=i.getInetAddresses(); en2.hasMoreElements(); ) {
      InetAddress addr=(InetAddress)en2.nextElement();
      if (!addr.isLoopbackAddress()) {
        if (addr instanceof Inet4Address) {
          if (preferIPv6) {
            continue;
          }
          return addr;
        }
        if (addr instanceof Inet6Address) {
          if (preferIPv4) {
            continue;
          }
          return addr;
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Get non-loopback address.  InetAddress.getLocalHost() does not work on machines without static ip address.
 * @param preferIPv4 true iff require IPv4 addresses only
 * @param preferIPv6 true iff prefer IPv6 addresses
 * @return nonLoopback {@link InetAddress}
 * @throws SocketException
 */
private static InetAddress getFirstNonLoopbackAddress(boolean preferIPv4,boolean preferIPv6) throws SocketException {
  Enumeration en=NetworkInterface.getNetworkInterfaces();
  while (en.hasMoreElements()) {
    NetworkInterface i=(NetworkInterface)en.nextElement();
    if (i.isPointToPoint()) {
      continue;
    }
    if (!i.isUp()) {
      continue;
    }
    for (Enumeration en2=i.getInetAddresses(); en2.hasMoreElements(); ) {
      InetAddress addr=(InetAddress)en2.nextElement();
      if (!addr.isLoopbackAddress()) {
        if (addr instanceof Inet4Address) {
          if (preferIPv6) {
            continue;
          }
          return addr;
        }
        if (addr instanceof Inet6Address) {
          if (preferIPv4) {
            continue;
          }
          return addr;
        }
      }
    }
  }
  return null;
}
Program: 19285
Project: 19285
Buggy source:
@Test public void testTouchedExpiryPolicy(){
  TouchedExpiryPolicy policy=new TouchedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,20));
  TouchedExpiryPolicy policy2=new TouchedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,20));
  TouchedExpiryPolicy policy3=new TouchedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,10));
  assertEquals(policy,policy2);
  assertNotEquals(policy,policy3);
  assertEquals(policy.hashCode(),policy2.hashCode());
  assertNotEquals(policy.hashCode(),policy3.hashCode());
  MutableConfiguration<Integer,Integer> config=new MutableConfiguration<>();
  config.setExpiryPolicyFactory(FactoryBuilder.factoryOf(policy)).setStatisticsEnabled(true);
  Cache<Integer,Integer> cache=Caching.getCachingProvider().getCacheManager().createCache("String_Node_Str",config);
  assertEquals(20,policy.getExpiryForCreation().getDurationAmount());
  assertEquals(20,policy.getExpiryForAccess().getDurationAmount());
  assertEquals(20,policy.getExpiryForUpdate().getDurationAmount());
}

Fixed version (ground truth):
@Test public void testTouchedExpiryPolicy(){
  TouchedExpiryPolicy policy=new TouchedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,20));
  TouchedExpiryPolicy policy2=new TouchedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,20));
  TouchedExpiryPolicy policy3=new TouchedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,10));
  assertEquals(policy,policy2);
  assertNotEquals(policy,policy3);
  assertEquals(policy.hashCode(),policy2.hashCode());
  assertNotEquals(policy.hashCode(),policy3.hashCode());
  MutableConfiguration<Integer,Integer> config=new MutableConfiguration<>();
  config.setExpiryPolicyFactory(FactoryBuilder.factoryOf(policy)).setStatisticsEnabled(true);
  Cache<Integer,Integer> cache=cacheManager.createCache(getTestCacheName(),config);
  assertEquals(20,policy.getExpiryForCreation().getDurationAmount());
  assertEquals(20,policy.getExpiryForAccess().getDurationAmount());
  assertEquals(20,policy.getExpiryForUpdate().getDurationAmount());
}
Program: 19286
Project: 19286
Buggy source:
@Test public void testAccessedExpiryPolicy(){
  AccessedExpiryPolicy policy=new AccessedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,20));
  AccessedExpiryPolicy policy2=new AccessedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,20));
  AccessedExpiryPolicy policy3=new AccessedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,10));
  assertEquals(policy,policy2);
  assertNotEquals(policy,policy3);
  assertEquals(policy.hashCode(),policy2.hashCode());
  assertNotEquals(policy.hashCode(),policy3.hashCode());
  MutableConfiguration<Integer,Integer> config=new MutableConfiguration<>();
  config.setExpiryPolicyFactory(FactoryBuilder.factoryOf(policy)).setStatisticsEnabled(true);
  Cache<Integer,Integer> cache=Caching.getCachingProvider().getCacheManager().createCache("String_Node_Str",config);
  assertEquals(20,policy.getExpiryForCreation().getDurationAmount());
  assertEquals(20,policy.getExpiryForAccess().getDurationAmount());
  assertNull(policy.getExpiryForUpdate());
}

Fixed version (ground truth):
@Test public void testAccessedExpiryPolicy(){
  AccessedExpiryPolicy policy=new AccessedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,20));
  AccessedExpiryPolicy policy2=new AccessedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,20));
  AccessedExpiryPolicy policy3=new AccessedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,10));
  assertEquals(policy,policy2);
  assertNotEquals(policy,policy3);
  assertEquals(policy.hashCode(),policy2.hashCode());
  assertNotEquals(policy.hashCode(),policy3.hashCode());
  MutableConfiguration<Integer,Integer> config=new MutableConfiguration<>();
  config.setExpiryPolicyFactory(FactoryBuilder.factoryOf(policy)).setStatisticsEnabled(true);
  Cache<Integer,Integer> cache=cacheManager.createCache(getTestCacheName(),config);
  assertEquals(20,policy.getExpiryForCreation().getDurationAmount());
  assertEquals(20,policy.getExpiryForAccess().getDurationAmount());
  assertNull(policy.getExpiryForUpdate());
}
Program: 19287
Project: 19287
Buggy source:
@Test public void testEternalExpiryPolicy(){
  EternalExpiryPolicy policy=new EternalExpiryPolicy();
  EternalExpiryPolicy policy2=new EternalExpiryPolicy();
  assertEquals(policy,policy2);
  assertEquals(policy.hashCode(),policy2.hashCode());
  MutableConfiguration<Integer,Integer> config=new MutableConfiguration<>();
  config.setExpiryPolicyFactory(FactoryBuilder.factoryOf(policy)).setStatisticsEnabled(true);
  Cache<Integer,Integer> cache=Caching.getCachingProvider().getCacheManager().createCache("String_Node_Str",config);
  assertEquals(ETERNAL,policy.getExpiryForCreation());
  assertNull(policy.getExpiryForAccess());
  assertNull(policy.getExpiryForUpdate());
}

Fixed version (ground truth):
@Test public void testEternalExpiryPolicy(){
  EternalExpiryPolicy policy=new EternalExpiryPolicy();
  EternalExpiryPolicy policy2=new EternalExpiryPolicy();
  assertEquals(policy,policy2);
  assertEquals(policy.hashCode(),policy2.hashCode());
  MutableConfiguration<Integer,Integer> config=new MutableConfiguration<>();
  config.setExpiryPolicyFactory(FactoryBuilder.factoryOf(policy)).setStatisticsEnabled(true);
  Cache<Integer,Integer> cache=cacheManager.createCache(getTestCacheName(),config);
  assertEquals(ETERNAL,policy.getExpiryForCreation());
  assertNull(policy.getExpiryForAccess());
  assertNull(policy.getExpiryForUpdate());
}
Program: 19288
Project: 19288
Buggy source:
@Test public void testCreatedExpiryPolicy(){
  ExpiryPolicy policy=CreatedExpiryPolicy.factoryOf(new Duration(TimeUnit.MILLISECONDS,20)).create();
  CreatedExpiryPolicy policy2=new CreatedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,20));
  CreatedExpiryPolicy policy3=new CreatedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,10));
  assertEquals(policy,policy2);
  assertNotEquals(policy,policy3);
  assertEquals(policy.hashCode(),policy2.hashCode());
  assertNotEquals(policy.hashCode(),policy3.hashCode());
  MutableConfiguration<Integer,Integer> config=new MutableConfiguration<>();
  config.setExpiryPolicyFactory(FactoryBuilder.factoryOf(policy2)).setStatisticsEnabled(true);
  Cache<Integer,Integer> cache=Caching.getCachingProvider().getCacheManager().createCache("String_Node_Str",config);
  assertEquals(20,policy.getExpiryForCreation().getDurationAmount());
  assertNull(policy.getExpiryForAccess());
  assertNull(policy.getExpiryForUpdate());
}

Fixed version (ground truth):
@Test public void testCreatedExpiryPolicy(){
  ExpiryPolicy policy=CreatedExpiryPolicy.factoryOf(new Duration(TimeUnit.MILLISECONDS,20)).create();
  CreatedExpiryPolicy policy2=new CreatedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,20));
  CreatedExpiryPolicy policy3=new CreatedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,10));
  assertEquals(policy,policy2);
  assertNotEquals(policy,policy3);
  assertEquals(policy.hashCode(),policy2.hashCode());
  assertNotEquals(policy.hashCode(),policy3.hashCode());
  MutableConfiguration<Integer,Integer> config=new MutableConfiguration<>();
  config.setExpiryPolicyFactory(FactoryBuilder.factoryOf(policy2)).setStatisticsEnabled(true);
  Cache<Integer,Integer> cache=cacheManager.createCache(getTestCacheName(),config);
  assertEquals(20,policy.getExpiryForCreation().getDurationAmount());
  assertNull(policy.getExpiryForAccess());
  assertNull(policy.getExpiryForUpdate());
}
Program: 19289
Project: 19289
Buggy source:
@Test public void testModifiedExpiryPolicy(){
  ModifiedExpiryPolicy policy=new ModifiedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,20));
  ModifiedExpiryPolicy policy2=new ModifiedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,20));
  ModifiedExpiryPolicy policy3=new ModifiedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,10));
  assertEquals(policy,policy2);
  assertNotEquals(policy,policy3);
  assertEquals(policy.hashCode(),policy2.hashCode());
  assertNotEquals(policy.hashCode(),policy3.hashCode());
  MutableConfiguration<Integer,Integer> config=new MutableConfiguration<>();
  config.setExpiryPolicyFactory(FactoryBuilder.factoryOf(policy)).setStatisticsEnabled(true);
  Cache<Integer,Integer> cache=Caching.getCachingProvider().getCacheManager().createCache("String_Node_Str",config);
  assertEquals(20,policy.getExpiryForCreation().getDurationAmount());
  assertNull(policy.getExpiryForAccess());
  assertEquals(20,policy.getExpiryForUpdate().getDurationAmount());
}

Fixed version (ground truth):
@Test public void testModifiedExpiryPolicy(){
  ModifiedExpiryPolicy policy=new ModifiedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,20));
  ModifiedExpiryPolicy policy2=new ModifiedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,20));
  ModifiedExpiryPolicy policy3=new ModifiedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,10));
  assertEquals(policy,policy2);
  assertNotEquals(policy,policy3);
  assertEquals(policy.hashCode(),policy2.hashCode());
  assertNotEquals(policy.hashCode(),policy3.hashCode());
  MutableConfiguration<Integer,Integer> config=new MutableConfiguration<>();
  config.setExpiryPolicyFactory(FactoryBuilder.factoryOf(policy)).setStatisticsEnabled(true);
  Cache<Integer,Integer> cache=cacheManager.createCache(getTestCacheName(),config);
  assertEquals(20,policy.getExpiryForCreation().getDurationAmount());
  assertNull(policy.getExpiryForAccess());
  assertEquals(20,policy.getExpiryForUpdate().getDurationAmount());
}
Program: 19290
Project: 19290
Buggy source:
@Before public void setUp() throws IOException {
  getCacheManager().createCache(getTestCacheName(),extraSetup(newMutableConfiguration()));
}

Fixed version (ground truth):
@Before public void setUp() throws IOException {
  cache=getCacheManager().createCache(getTestCacheName(),extraSetup(newMutableConfiguration()));
}
Program: 19291
Project: 19291
Buggy source:
/** 
 * Obtains the internal   {@link Client} used to communicate with the{@link org.jsr107.tck.integration.CacheLoaderServer}.  If the   {@link Client} is not connected, aconnection will be attempted.
 * @return the {@link Client}
 */
protected synchronized Client getClient(){
  if (client == null) {
    try {
      client=new Client(address,port);
    }
 catch (    Exception e) {
      throw new RuntimeException("String_Node_Str",e);
    }
  }
  return client;
}

Fixed version (ground truth):
/** 
 * Obtains the internal   {@link Client} used to communicate with the{@link org.jsr107.tck.integration.CacheLoaderServer}.  If the   {@link Client} is not connected, aconnection will be attempted.
 * @return the {@link Client}
 */
protected synchronized Client getClient(){
  if (client == null) {
    try {
      client=new Client(address,port);
    }
 catch (    Exception e) {
      throw new RuntimeException("String_Node_Str" + address + "String_Node_Str"+ port,e);
    }
  }
  return client;
}
Program: 19292
Project: 19292
Buggy source:
/** 
 * Constructs a   {@link Client} that will auto connect to a {@link Server}on the specified port.
 * @param address the {@link InetAddress} on which the {@link Server}is accepting requests
 * @param port    the port on which the {@link Server} isis accepting requests
 * @throws IOException when the {@link Client} can't connect to the{@link Server}
 */
public Client(InetAddress address,int port) throws IOException {
  this.port=port;
  this.socket=new Socket(address,port);
  this.oos=new ObjectOutputStream(socket.getOutputStream());
  this.ois=new ObjectInputStream(socket.getInputStream());
}

Fixed version (ground truth):
/** 
 * Constructs a   {@link Client} that will auto connect to a {@link Server}on the specified port.
 * @param address the {@link InetAddress} on which the {@link Server}is accepting requests
 * @param port    the port on which the {@link Server} isis accepting requests
 * @throws IOException when the {@link Client} can't connect to the{@link Server}
 */
public Client(InetAddress address,int port) throws IOException {
  this.port=port;
  try {
    this.socket=new Socket(address,port);
  }
 catch (  IOException ioe) {
    throw new IOException("String_Node_Str" + address + "String_Node_Str"+ port,ioe);
  }
  this.oos=new ObjectOutputStream(socket.getOutputStream());
  this.ois=new ObjectInputStream(socket.getInputStream());
}
Program: 19293
Project: 19293
Buggy source:
/** 
 * Obtains the   {@link InetAddress} on which the {@link Server} is listening.
 * @return the {@link InetAddress}
 */
public synchronized InetAddress getInetAddress(){
  if (serverSocket != null) {
    return serverSocket.getInetAddress();
  }
 else {
    throw new IllegalStateException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Obtains the   {@link InetAddress} on which the {@link Server} is listening.
 * @return the {@link InetAddress}
 */
public synchronized InetAddress getInetAddress(){
  if (serverSocket != null) {
    try {
      return getServerInetAddress();
    }
 catch (    SocketException e) {
      return serverSocket.getInetAddress();
    }
catch (    UnknownHostException e) {
      return serverSocket.getInetAddress();
    }
  }
 else {
    throw new IllegalStateException("String_Node_Str");
  }
}
Program: 19294
Project: 19294
Buggy source:
/** 
 * Opens and starts the   {@link Server}. <p/> Does nothing if the   {@link Server} is already open.
 * @return the {@link InetAddress} on which the {@link Server}is accepting requests from   {@link Client}s.
 */
public synchronized InetAddress open() throws IOException {
  if (serverSocket == null) {
    serverSocket=new ServerSocket(port);
    serverThread=new Thread(new Runnable(){
      @Override public void run(){
        try {
          int connectionId=0;
          while (!isTerminating.get()) {
            Socket socket=serverSocket.accept();
            ClientConnection clientConnection=new ClientConnection(connectionId++,socket);
            clientConnections.put(clientConnection.getIdentity(),clientConnection);
            clientConnection.start();
          }
        }
 catch (        NullPointerException e) {
          isTerminating.compareAndSet(false,true);
        }
catch (        IOException e) {
          isTerminating.compareAndSet(false,true);
        }
      }
    }
);
    serverThread.start();
  }
  return serverSocket.getInetAddress();
}

Fixed version (ground truth):
/** 
 * Opens and starts the   {@link Server}. <p/> Does nothing if the   {@link Server} is already open.
 * @return the {@link InetAddress} on which the {@link Server}is accepting requests from   {@link Client}s.
 */
public synchronized InetAddress open() throws IOException {
  if (serverSocket == null) {
    serverSocket=createServerSocket();
    serverThread=new Thread(new Runnable(){
      @Override public void run(){
        try {
          int connectionId=0;
          while (!isTerminating.get()) {
            Socket socket=serverSocket.accept();
            ClientConnection clientConnection=new ClientConnection(connectionId++,socket);
            clientConnections.put(clientConnection.getIdentity(),clientConnection);
            clientConnection.start();
          }
        }
 catch (        NullPointerException e) {
          isTerminating.compareAndSet(false,true);
        }
catch (        IOException e) {
          isTerminating.compareAndSet(false,true);
        }
      }
    }
);
    serverThread.start();
  }
  return getInetAddress();
}
Program: 19295
Project: 19295
Buggy source:
/** 
 * Ensure that <code>null</code> entries can be passed from the  {@link CacheLoaderServer} back to the {@link CacheLoaderClient}.
 */
@Test public void shouldLoadNullValuesFromServerWithClient(){
  NullValueCacheLoader<String,String> nullCacheLoader=new NullValueCacheLoader<>();
  CacheLoaderServer<String,String> serverCacheLoader=new CacheLoaderServer<String,String>(10000,nullCacheLoader);
  try {
    serverCacheLoader.open();
    CacheLoaderClient<String,String> clientCacheLoader=new CacheLoaderClient<>(serverCacheLoader.getInetAddress(),10000);
    String value=clientCacheLoader.load("String_Node_Str");
    Assert.assertThat(value,is(nullValue()));
  }
 catch (  Exception e) {
  }
 finally {
    serverCacheLoader.close();
  }
}

Fixed version (ground truth):
/** 
 * Ensure that <code>null</code> entries can be passed from the  {@link CacheLoaderServer} back to the {@link CacheLoaderClient}.
 */
@Test public void shouldLoadNullValuesFromServerWithClient(){
  NullValueCacheLoader<String,String> nullCacheLoader=new NullValueCacheLoader<>();
  CacheLoaderServer<String,String> serverCacheLoader=new CacheLoaderServer<String,String>(10000,nullCacheLoader);
  try {
    serverCacheLoader.open();
    CacheLoaderClient<String,String> clientCacheLoader=new CacheLoaderClient<>(serverCacheLoader.getInetAddress(),serverCacheLoader.getPort());
    String value=clientCacheLoader.load("String_Node_Str");
    Assert.assertThat(value,is(nullValue()));
  }
 catch (  Exception e) {
  }
 finally {
    serverCacheLoader.close();
  }
}
Program: 19296
Project: 19296
Buggy source:
/** 
 * Ensure that values can be loaded from the   {@link CacheLoaderClient} viathe  {@link CacheLoaderServer}.
 */
@Test public void shouldLoadFromServerWithClient(){
  RecordingCacheLoader<String> recordingCacheLoader=new RecordingCacheLoader<String>();
  CacheLoaderServer<String,String> serverCacheLoader=new CacheLoaderServer<String,String>(10000,recordingCacheLoader);
  try {
    serverCacheLoader.open();
    CacheLoaderClient<String,String> clientCacheLoader=new CacheLoaderClient<>(serverCacheLoader.getInetAddress(),10000);
    String value=clientCacheLoader.load("String_Node_Str");
    Assert.assertThat(value,is(notNullValue()));
    Assert.assertThat(value,is("String_Node_Str"));
    Assert.assertThat(recordingCacheLoader.hasLoaded("String_Node_Str"),is(true));
  }
 catch (  Exception e) {
  }
 finally {
    serverCacheLoader.close();
  }
}

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

Fixed version (ground truth):
/** 
 * Ensure that exceptions thrown by an underlying cache loader are re-thrown.
 */
@Test public void shouldRethrowExceptions(){
  FailingCacheLoader<String,String> failingCacheLoader=new FailingCacheLoader<>();
  CacheLoaderServer<String,String> serverCacheLoader=new CacheLoaderServer<String,String>(10000,failingCacheLoader);
  try {
    serverCacheLoader.open();
    CacheLoaderClient<String,String> clientCacheLoader=new CacheLoaderClient<>(serverCacheLoader.getInetAddress(),serverCacheLoader.getPort());
    String value=clientCacheLoader.load("String_Node_Str");
    fail("String_Node_Str");
  }
 catch (  Exception e) {
  }
 finally {
    serverCacheLoader.close();
  }
}
Program: 19298
Project: 19298
Buggy source:
/** 
 * Ensure that entry can be written from the   {@link CacheWriterClient} viathe  {@link CacheWriterServer}.
 */
@Test public void shouldWriteFromServerWithClient(){
  RecordingCacheWriter<String,String> recordingCacheWriter=new RecordingCacheWriter<>();
  CacheWriterServer<String,String> serverCacheWriter=new CacheWriterServer<>(10000,recordingCacheWriter);
  try {
    serverCacheWriter.open();
    CacheWriterClient<String,String> clientCacheWriter=new CacheWriterClient<>(serverCacheWriter.getInetAddress(),10000);
    Cache.Entry<String,String> entry=new Entry<>("String_Node_Str","String_Node_Str");
    clientCacheWriter.write(entry);
    String writtenValue=recordingCacheWriter.get("String_Node_Str");
    Assert.assertThat(writtenValue,is(notNullValue()));
    Assert.assertThat(writtenValue,is("String_Node_Str"));
    Assert.assertThat(recordingCacheWriter.hasWritten("String_Node_Str"),is(true));
  }
 catch (  Exception e) {
  }
 finally {
    serverCacheWriter.close();
  }
}

Fixed version (ground truth):
/** 
 * Ensure that entry can be written from the   {@link CacheWriterClient} viathe  {@link CacheWriterServer}.
 */
@Test public void shouldWriteFromServerWithClient(){
  RecordingCacheWriter<String,String> recordingCacheWriter=new RecordingCacheWriter<>();
  CacheWriterServer<String,String> serverCacheWriter=new CacheWriterServer<>(10000,recordingCacheWriter);
  try {
    serverCacheWriter.open();
    CacheWriterClient<String,String> clientCacheWriter=new CacheWriterClient<>(serverCacheWriter.getInetAddress(),serverCacheWriter.getPort());
    Cache.Entry<String,String> entry=new Entry<>("String_Node_Str","String_Node_Str");
    clientCacheWriter.write(entry);
    String writtenValue=recordingCacheWriter.get("String_Node_Str");
    Assert.assertThat(writtenValue,is(notNullValue()));
    Assert.assertThat(writtenValue,is("String_Node_Str"));
    Assert.assertThat(recordingCacheWriter.hasWritten("String_Node_Str"),is(true));
  }
 catch (  Exception e) {
  }
 finally {
    serverCacheWriter.close();
  }
}
Program: 19299
Project: 19299
Buggy source:
/** 
 * Ensure that exceptions thrown by an underlying cache Writer are re-thrown.
 */
@Test public void shouldRethrowExceptions(){
  FailingCacheWriter<String,String> failingCacheWriter=new FailingCacheWriter<>();
  CacheWriterServer<String,String> serverCacheWriter=new CacheWriterServer<>(10000,failingCacheWriter);
  try {
    serverCacheWriter.open();
    CacheWriterClient<String,String> clientCacheWriter=new CacheWriterClient<>(serverCacheWriter.getInetAddress(),10000);
    Cache.Entry<String,String> entry=new Entry<>("String_Node_Str","String_Node_Str");
    clientCacheWriter.write(entry);
    fail("String_Node_Str");
  }
 catch (  Exception e) {
  }
 finally {
    serverCacheWriter.close();
  }
}

Fixed version (ground truth):
/** 
 * Ensure that exceptions thrown by an underlying cache Writer are re-thrown.
 */
@Test public void shouldRethrowExceptions(){
  FailingCacheWriter<String,String> failingCacheWriter=new FailingCacheWriter<>();
  CacheWriterServer<String,String> serverCacheWriter=new CacheWriterServer<>(10000,failingCacheWriter);
  try {
    serverCacheWriter.open();
    CacheWriterClient<String,String> clientCacheWriter=new CacheWriterClient<>(serverCacheWriter.getInetAddress(),serverCacheWriter.getPort());
    Cache.Entry<String,String> entry=new Entry<>("String_Node_Str","String_Node_Str");
    clientCacheWriter.write(entry);
    fail("String_Node_Str");
  }
 catch (  Exception e) {
  }
 finally {
    serverCacheWriter.close();
  }
}
Program: 19301
Project: 19301
Buggy source:
@Test public void invokeAllReadThroughEnabledGetOnNonExistentEntry() throws IOException {
  RecordingCacheLoader<Integer> recordingCacheLoader=new RecordingCacheLoader<>();
  try (CacheLoaderServer<Integer,Integer> cacheLoaderServer=new CacheLoaderServer<>(10000,recordingCacheLoader)){
    cacheLoaderServer.open();
    CacheLoaderClient<Integer,Integer> cacheLoader=new CacheLoaderClient<>(cacheLoaderServer.getInetAddress(),cacheLoaderServer.getPort());
    CountingExpiryPolicy expiryPolicy=new CountingExpiryPolicy();
    expiryPolicyServer.setExpiryPolicy(expiryPolicy);
    MutableConfiguration<Integer,Integer> config=new MutableConfiguration<>();
    config.setExpiryPolicyFactory(FactoryBuilder.factoryOf(expiryPolicyClient));
    config.setCacheLoaderFactory(FactoryBuilder.factoryOf(cacheLoader));
    config.setReadThrough(true);
    Cache<Integer,Integer> cache=getCacheManager().createCache(getTestCacheName(),config);
    final Integer INITIAL_KEY=123;
    final Integer MAX_KEY_VALUE=INITIAL_KEY + 4;
    Set<Integer> keys=new HashSet<>();
    for (int key=INITIAL_KEY; key <= MAX_KEY_VALUE; key++) {
      keys.add(key);
    }
    Map<Integer,Integer> resultMap=cache.invokeAll(keys,new GetEntryProcessor<Integer,Integer>());
    assertThat(expiryPolicy.getCreationCount(),greaterThanOrEqualTo(keys.size()));
    assertThat(expiryPolicy.getAccessCount(),is(0));
    assertThat(expiryPolicy.getUpdatedCount(),is(0));
    expiryPolicy.resetCount();
  }
 }

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