[Demonstration 1]

[Buggy Method]
public void greet(String deviceIdentifier, String digitalSignaturePublicKey, String metadata, int purpose, final Adapter.JsonObjectCallback callback) {
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("deviceIdentifier", deviceIdentifier);
    params.put("digitalSignaturePublicKey", deviceIdentifier);
    params.put("metadata", metadata);
    params.put("purpose", purpose);
    invokeStaticMethod("greet", params, new Adapter.JsonObjectCallback() {

        @Override
        public void onError(Throwable t) {
            callback.onError(t);
        }

        @Override
        public void onSuccess(JSONObject response) {
            callback.onSuccess(response);
        }
    });
}

[Buggy Hunk]
params.put("digitalSignaturePublicKey", deviceIdentifier);

[Patch]
params.put("digitalSignaturePublicKey", digitalSignaturePublicKey);

[Demonstration 2]

[Buggy Method]
private int[][] generateInitialPopulation(int populationSize, int bitArrayLength) {
    int[][] initialPopulation = new int[populationSize][bitArrayLength + 1];
    for (int i = 0; i < populationSize; i++) {
        for (int j = 0; j < bitArrayLength - 1; j++) {
            initialPopulation[i][j] = (int) Math.round(Math.random());
        }
    }
    return initialPopulation;
}

[Buggy Hunk]
for (int j = 0; j < bitArrayLength - 1; j++) {

[Patch]
for (int j = 0; j < bitArrayLength; j++) {

[Demonstration 3]

[Buggy Method]
@Test
public void testUnflatSimpleArray() {
    Vertex vertex = graph.addVertex(null);
    defineSimpleArray1(vertex);
    HashMap<String, Object> unflattedProperties = new HashMap<String, Object>();
    MappingDSGraphDBObjectProps.unflatVertexPropsToObjects(vertex, unflattedProperties, MappingDSGraphPropertyNames.DD_CONTAINER_PROPS_KEY);
    //System.out.println(unflattedProperties);
    assertTrue(unflattedProperties.containsKey("simpleArray1"));
    assertTrue(unflattedProperties.get("simpleArray1").equals(simpleArray1));
}

[Buggy Hunk]
HashMap<String, Object> unflattedProperties = new HashMap<String, Object>();

[Patch]
HashMap<String, Object> unflattedProperties = new HashMap<>();