[Demonstration 1]

[Buggy Method]
private void createInitialPopulation() {
    population = new ArrayList<>(POPULATION_SIZE);
    next = new ArrayList<>(POPULATION_SIZE);
    for (int i = 0; i < POPULATION_SIZE; i++) {
        population.add(new HunterGenome(numberOfWeights));
    }
}

[Buggy Hunk]
population.add(new HunterGenome(numberOfWeights));

[Patch]
population.add(new HunterGenome(this, numberOfWeights));

[Demonstration 2]

[Buggy Method]
@Override
public void onCompleted(Exception ex) {
    //ex.printStackTrace();
    LOG.log(Level.FINE, "WebSocket onClose ");
    Socket.this.webSocket = null;
    scheduleReconnectTimer();
    for (final ISocketCloseCallback callback : socketCloseCallbacks) {
        callback.onClose();
    }
}

[Buggy Hunk]
for (final ISocketCloseCallback callback : socketCloseCallbacks) {

[Patch]
for ( ISocketCloseCallback callback : socketCloseCallbacks) {

[Demonstration 3]

[Buggy Method]
public static String[] getPropertyNames(Class clazz, boolean recursive) {
    ArrayList<String> fieldNames = new ArrayList<String>();
    String[] currentPropertNames = getPropertyNames(clazz);
    for (String propertyName : currentPropertNames) {
        fieldNames.add(propertyName);
    }
    if (recursive) {
        Class childClass = clazz;
        while (childClass != null && childClass != Object.class) {
            String[] propertNames = getPropertyNames(childClass);
            for (String propertyName : propertNames) {
                if (fieldNames.contains(propertyName)) {
                    fieldNames.add(propertyName);
                }
            }
            childClass = childClass.getSuperclass();
        }
    }
    return (String[]) fieldNames.toArray(new String[fieldNames.size()]);
}

[Buggy Hunk]
ArrayList<String> fieldNames = new ArrayList<String>();

[Patch]
Set<String> fieldNames = new HashSet<String>();