[Demonstration 1]

[Buggy Method]
public void add(String id, Bucket bucket, Object object) throws JsonProcessingException {
    Objects.requireNonNull(id);
    Objects.requireNonNull(bucket);
    Objects.requireNonNull(object);
    JsonObject jsonObject = JsonObject.fromJson(ofsObjectMapper.writeValueAsString(object));
    JsonDocument jsonDocument = JsonDocument.create(id, jsonObject);
    couchbaseFactory.getUserBucket().insert(jsonDocument);
}

[Buggy Hunk]
couchbaseFactory.getUserBucket().insert(jsonDocument);

[Patch]
bucket.insert(jsonDocument);

[Demonstration 2]

[Buggy Method]
public byte[] serialise() {
    JSONObject object = new JSONObject();
    object.put(TASK_ID.getValue(), taskId);
    object.put(STATUS.getValue(), status.name());
    object.put(STATUS_CHANGE_TIME.getValue(), statusChangeTime.toEpochMilli());
    object.put(STATUS_CHANGE_BY.getValue(), statusChangedBy);
    object.put(CREATED_BY.getValue(), creator);
    object.put(ENGINE_ID.getValue(), engineID);
    object.put(RUN_AT.getValue(), runAt.toEpochMilli());
    object.put(RECURRING.getValue(), recurring);
    object.put(RECUR_INTERVAL.getValue(), interval);
    object.put(STACK_TRACE.getValue(), stackTrace);
    object.put(TASK_EXCEPTION.getValue(), exception);
    object.put(TASK_CHECKPOINT.getValue(), taskCheckpoint);
    object.put(TASK_CONFIGURATION.getValue(), configuration != null ? configuration.toString() : new JSONObject().toString());
    object.put(TASK_CLASS_NAME.getValue(), taskClassName);
    return object.toString().getBytes();
}

[Buggy Hunk]
return object.toString().getBytes();

[Patch]
return object.toString().getBytes(StandardCharsets.UTF_8);

[Demonstration 3]

[Buggy Method]
@Test
public void serializesBuiltInTypes() {
    BuiltInTypes o = new BuiltInTypes();
    o.boolField = true;
    o.byteField = 1;
    o.charField = '0';
    o.shortField = 2;
    o.intField = 3;
    o.longField = 4L;
    o.floatField = 5F;
    o.doubleField = 6.0;
    o.bigIntField = BigInteger.valueOf(7);
    o.bigDecimalField = BigDecimal.valueOf(8);
    o.list = Arrays.<Object>asList("foo", 1);
    o.map = new HashMap<>();
    o.map.put("key1", "value");
    o.map.put("key2", 23);
    o.set = new HashSet<>(Arrays.<Object>asList("bar", 2));
    JsonNode node = JSONRunner.serialize(o);
    assertEquals(true, node.get("boolField").asBoolean());
    assertEquals(1, node.get("byteField").asInt());
    assertEquals("0", node.get("charField").asText());
    assertEquals(2, node.get("shortField").asInt());
    assertEquals(3, node.get("intField").asInt());
    assertEquals(4, node.get("longField").asInt());
    assertEquals(5, node.get("floatField").asInt());
    assertEquals(6, node.get("doubleField").asInt());
    assertEquals(7, node.get("bigIntField").asInt());
    assertEquals(8, node.get("bigDecimalField").asInt());
    assertEquals(2, node.get("list").size());
    assertEquals("foo", node.get("list").get(0).textValue());
    assertEquals(1, node.get("list").get(1).intValue());
    assertEquals("value", node.get("map").get("key1").asText());
    assertEquals(23, node.get("map").get("key2").asInt());
    assertEquals(2, node.get("set").size());
}

[Buggy Hunk]
o.list = Arrays.<Object>asList("foo", 1);

[Patch]
o.list = Arrays.asList("foo", 1);