[Demonstration 1]

[Buggy Method]
private IndexStorage encodeAndCompressNoDictDimension(byte[][] data, boolean isSort, boolean isUseInvertedIndex) {
    if (isUseInvertedIndex) {
        if (version == ColumnarFormatVersion.V3) {
            return new BlockIndexerStorageForShort(data, false, true, isSort);
        } else {
            return new BlockIndexerStorageForInt(data, false, true, isSort);
        }
    } else {
        if (version == ColumnarFormatVersion.V3) {
            return new BlockIndexerStorageForNoInvertedIndexForShort(data, true);
        } else {
            return new BlockIndexerStorageForNoInvertedIndex(data);
        }
    }
}

[Buggy Hunk]
return new BlockIndexerStorageForNoInvertedIndexForShort(data, true);

[Patch]
return new BlockIndexerStorageForNoInvertedIndexForShort(true, data);

[Demonstration 2]

[Buggy Method]
public Biomorph evolveClo(Biomorph father, Biomorph mother) {
    EvolveClosest ec = new EvolveClosest(father, mother, perfectValues);
    Biomorph biomorph = ec.evolve();
    statisticMachine.saveGeneValues(ec.getChildGenes());
    statisticMachine.printRunningStats();
    biomorphCollection.add(0, biomorph);
    createAndAdd();
    return biomorph;
}

[Buggy Hunk]
biomorphCollection.add(0,biomorph);

[Patch]
biomorphCollection.addFirst(biomorph);

[Demonstration 3]

[Buggy Method]
public static void main(String[] args) {
    Matrix matrix = new Matrix(new int[][] { { 1, 2, 1 }, { 1, 2, 1 }, { 1, 2, 1 } });
    Matrix matrix1 = new Matrix(new int[][] { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } });
    System.out.println(matrix.toString());
    System.out.println(matrix1.toString());
    System.out.println(matrix.multiply(matrix1).toString());
    Matrix gaussianBlur = new Matrix(new int[][] { { 1, 2, 3 }, { 8, 1, 4 }, { 7, 6, 5 } });
    System.out.printf("Convolve = %.3f%n", matrix.convolve(gaussianBlur));
    System.out.println(gaussianBlur.getSurroundingValues(0, 0));
    final Matrix x = matrix.vertCat(matrix).horzCat(gaussianBlur.vertCat(gaussianBlur));
    System.out.println(x);
    System.out.println(x.subMatrix(1, 1, 6, 6));
}

[Buggy Hunk]
System.out.println(x.subMatrix(1, 1, 6, 6));

[Patch]
System.out.println(x.subMatrix(3, 4, 5, 5));