[Demonstration 1]

[Buggy Method]
@Test
public void testShutdownClosesChannel() throws IOException {
    final BaseProcessor processor = new AbstractProcessorImpl(channel, plugin, data);
    when(channel.isOpen()).thenReturn(true);
    processor.shutdown();
    verify(channel, times(1)).close();
}

[Buggy Hunk]
verify(channel, times(1)).close();

[Patch]
verify(channel, times(1)).getConnection();

[Demonstration 2]

[Buggy Method]
public boolean createCustomTrack(int uid, String trackclass, String trackname, String description, String organism, String genomeVer, String settings, int order, String genCat, String category, String controls, Boolean vis, String location, String fileName, String type) {
    BrowserTrack bt = new BrowserTrack();
    int trackID = bt.getNextID(pool);
    BrowserTrack newTrack = new BrowserTrack(trackID, uid, trackclass, trackname, description, organism, settings, order, genCat, category, controls, vis, location, fileName, type, new Timestamp((new Date()).getTime()));
    boolean success = newTrack.saveToDB(genomeVer, pool);
    return success;
}

[Buggy Hunk]
BrowserTrack newTrack=new BrowserTrack(trackID, uid, trackclass, trackname, description, organism,settings, order,genCat,category,controls,vis,location,fileName,type,new Timestamp((new Date()).getTime()));

[Patch]
BrowserTrack newTrack=new BrowserTrack(trackID, uid, trackclass, trackname, description, organism,settings, order,genCat,category,controls,vis,location,fileName,type,new Timestamp((new Date()).getTime()),genomeVer);

[Demonstration 3]

[Buggy Method]
@Override
public void init(Properties props, String keyPrefix) {
    int startByte = ConfigUtil.getInt(props, keyPrefix + LinkBenchConstants.UNIFORM_GEN_STARTBYTE);
    int endByte = ConfigUtil.getInt(props, keyPrefix + LinkBenchConstants.UNIFORM_GEN_ENDBYTE);
    double uniqueness = ConfigUtil.getDouble(props, keyPrefix + LinkBenchConstants.MOTIF_GEN_UNIQUENESS);
    if (props.contains(keyPrefix + LinkBenchConstants.MOTIF_GEN_LENGTH)) {
        int motifBytes = ConfigUtil.getInt(props, keyPrefix + LinkBenchConstants.MOTIF_GEN_LENGTH);
        init(startByte, endByte, uniqueness, motifBytes);
    } else {
        init(startByte, endByte, uniqueness);
    }
}

[Buggy Hunk]
if (props.contains(keyPrefix + LinkBenchConstants.MOTIF_GEN_LENGTH)) {

[Patch]
if (props.containsValue(keyPrefix + LinkBenchConstants.MOTIF_GEN_LENGTH)) {