[Demonstration 1]

[Buggy Method]
public void generateMatrices() {
    List<String> filePaths = getFilePaths(this.root);
    System.out.println("Generating wordmap...");
    long startTime = System.nanoTime();
    generateWordmap(filePaths);
    System.out.println(String.format("Wordmap generation took %d seconds", (System.nanoTime() - startTime) / 1000000000));
    System.out.println("Generating matrices...");
    long startTime = System.nanoTime();
    ExecutorService pool = Executors.newFixedThreadPool(this.numThreads);
    for (String filePath : filePaths) {
        Future tmp = pool.submit(new DMatrixFileWorker(filePath, this));
        try {
            tmp.get();
        } catch (ExecutionException e) {
            System.out.println(e.getCause());
        } catch (InterruptedException e) {
        }
    }
    pool.shutdown();
    try {
        pool.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
    } catch (InterruptedException e) {
    }
    System.out.println(String.format("Matrix generation took %d seconds", (System.nanoTime() - startTime) / 1000000000));
}

[Buggy Hunk]
long startTime = System.nanoTime();

[Patch]
startTime = System.nanoTime();

[Demonstration 2]

[Buggy Method]
@Override
public boolean tryLock(@NotNull long time, @NotNull TimeUnit unit) throws InterruptedException {
    boolean result = getLock().tryLock(time, unit);
    if (result) {
        updateTimestamp();
    }
    return result;
}

[Buggy Hunk]
public boolean tryLock(@NotNull long time, @NotNull TimeUnit unit) throws InterruptedException {

[Patch]
public boolean tryLock(long time, TimeUnit unit) throws InterruptedException {

[Demonstration 3]

[Buggy Method]
@Nullable
public <T> T deserialize(@Nullable Ason ason, @NotNull Class<T> cls) {
    if (ason == null) {
        return null;
    } else if (isPrimitive(cls)) {
        throw new IllegalArgumentException("You cannot deserialize an object to a primitive type (" + cls.getName() + ").");
    } else if (cls == Ason.class || cls == JSONObject.class) {
        if (cls == JSONObject.class)
            return (T) ason.toStockJson();
        return (T) ason;
    } else if (cls == AsonArray.class || cls == JSONArray.class) {
        throw new IllegalArgumentException("You cannot deserialize an object to a JSON array.");
    }
    ClassCacheEntry<T> cacheEntry = classCache.get(cls);
    if (cacheEntry == null) {
        cacheEntry = new ClassCacheEntry<>(cls);
    }
    final T newObject = cacheEntry.newInstance();
    for (String name : cacheEntry.fields()) {
        final Class<?> type = cacheEntry.fieldType(name);
        if (isPrimitive(type) || type == JSONObject.class || type == JSONArray.class || type == Ason.class || type == AsonArray.class) {
            cacheEntry.set(newObject, name, ason.get(name));
        } else if (type.isArray()) {
            AsonArray asonArray = ason.get(name);
            cacheEntry.set(newObject, name, deserializeArray(asonArray, type.getComponentType()));
        } else if (isList(type)) {
            AsonArray asonArray = ason.get(name);
            Class<?> listItemType = cacheEntry.listItemType(name);
            cacheEntry.set(newObject, name, deserializeList(asonArray, listItemType));
        } else {
            Object value = ason.get(name);
            if (value instanceof Ason) {
                Ason asonObject = (Ason) value;
                cacheEntry.set(newObject, name, deserialize(asonObject, type));
            } else {
                AsonArray asonArray = (AsonArray) value;
                cacheEntry.set(newObject, name, deserializeArray(asonArray, type));
            }
        }
    }
    return newObject;
}

[Buggy Hunk]
cacheEntry.set(newObject, name, deserializeArray(asonArray, type.getComponentType()));

[Patch]
cacheEntry.set(newObject, name, deserializeArray(asonArray, type));