[Demonstration 1]

[Buggy Method]
private static Gson newInstance() {
    GsonBuilder builder = new GsonBuilder();
    // Init Gson builder
    builder.enableComplexMapKeySerialization();
    builder.setDateFormat(DateFormat.TIMESTAMP_ISO8601);
    builder.setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES);
    // Register an adapters
    for (TypeAdapterFactory factory : ServiceLoader.load(TypeAdapterFactory.class)) {
        builder.registerTypeAdapterFactory(factory);
    }
    builder.registerTypeAdapterFactory(new EnumTypeAdapterFactory());
    builder.registerTypeAdapter(URI.class, new URIAdapter());
    builder.registerTypeAdapter(Date.class, new DateAdapter());
    builder.registerTypeAdapter(Timestamp.class, new TimestampAdapter());
    // Done
    return builder.create();
}

[Buggy Hunk]
for (TypeAdapterFactory factory : ServiceLoader.load(TypeAdapterFactory.class)) {

[Patch]
for (TypeAdapterFactory factory : ServiceLoader.load(TypeAdapterFactory.class, DataMapper.class.getClassLoader())) {

[Demonstration 2]

[Buggy Method]
public static String toJson(BaseEntity entity) {
    return new GsonBuilder().registerTypeAdapter(Date.class, ser).create().toJson(entity);
}

[Buggy Hunk]
return new GsonBuilder().registerTypeAdapter(Date.class, ser).create().toJson(entity);

[Patch]
return C_CREATOR.toJson(entity);

[Demonstration 3]

[Buggy Method]
public static void RunSelfEquivLTLFile(Path filePath, TestThread tt) throws IOException {
    // parser p;
    // p.
    List<LTLNode> nodes = LTLParserProvider.parse(new FileReader(filePath.toFile()));
    for (LTLNode ltl : nodes) {
        Pair<BDDSolver, LTLFormula<BDD, BDD>> pair = LTLConverter.getLTLBDD(ltl);
        BDDSolver bdds = pair.first;
        LTLFormula<BDD, BDD> tot = pair.second.pushNegations(bdds);
        SAFA<BDD, BDD> safa = tot.getSAFA(bdds);
        if (tt.isRunning) {
            long startTime = System.currentTimeMillis();
            boolean b = true;
            long stopTime = System.currentTimeMillis();
            try {
                b = SAFA.isEquivalent(safa, safa, bdds, SumOfProductsFactory.getInstance());
                stopTime = System.currentTimeMillis();
            } catch (TimeoutException toe) {
                stopTime = System.currentTimeMillis() + timeout;
            }
            if (tt.isRunning) {
                long elapsedTime = stopTime - startTime;
                System.out.println(elapsedTime);
                startTime = System.currentTimeMillis();
                Pair<Boolean, List<BDD>> b1 = SAFA.areReverseEquivalent(safa, safa, bdds);
                if (tt.isRunning) {
                    stopTime = System.currentTimeMillis();
                    elapsedTime = stopTime - startTime;
                    System.out.println(elapsedTime);
                    if (b != b1.first)
                        throw new IllegalArgumentException("b and b1 should be the same");
                }
            }
        }
    }
}

[Buggy Hunk]
b = SAFA.isEquivalent(safa, safa, bdds, SumOfProductsFactory.getInstance());

[Patch]
b = SAFA.isEquivalent(safa, safa, bdds, SumOfProductsFactory.getInstance()).getFirst();