[Demonstration 1]

[Buggy Method]
private static Optional<Properties> getCertConfig(Path certFile) {
    Optional<Path> configFile = getConfigFileForCertificate(certFile);
    if (!configFile.isPresent()) {
        return Optional.empty();
    }
    Properties properties = new Properties();
    try {
        InputStream inputStream = Files.newInputStream(configFile.get());
        properties.load(inputStream);
    } catch (IOException e) {
        new UncheckedIOException(e);
    }
    return Optional.of(properties);
}

[Buggy Hunk]
new UncheckedIOException(e);

[Patch]
throw new UncheckedIOException(e);

[Demonstration 2]

[Buggy Method]
@Override
public int read() throws IOException {
    while (uncompressedChunkOffset >= uncompressedChunkLength) {
        int compressedChunkLength = bufferCompressedData();
        if (compressedChunkLength < 0) {
            return -1;
        }
        uncompressedChunkLength = decompressor.decompress(compressed, 0, compressedChunkLength, uncompressedChunk, 0, uncompressedChunk.length);
    }
    return uncompressedChunk[uncompressedChunkOffset--] & 0xFF;
}

[Buggy Hunk]
return uncompressedChunk[uncompressedChunkOffset--] & 0xFF;

[Patch]
return uncompressedChunk[uncompressedChunkOffset++] & 0xFF;

[Demonstration 3]

[Buggy Method]
public Optional<Clubber> find(String clubberId, PersonManager personManager, ClubManager clubManager) {
    return query(create -> {
        ClubberRecord record = create.selectFrom(CLUBBER).where(CLUBBER.ID.eq(clubberId.getBytes())).fetchOne();
        if (record == null)
            return Optional.empty();
        ClubberAdapter clubber = new ClubberAdapter(personManager.lookup(clubberId).get());
        byte[] clubId = record.getClubId();
        if (clubId != null) {
            clubber.setClub((ClubAdapter) clubManager.lookup(convert(clubId)).get());
        }
        clubber.getUpdater().setAgeGroup(AgeGroup.DefaultAgeGroup.valueOf(record.getAgeGroup()));
        byte[] familyId = record.getFamilyId();
        if (familyId != null) {
            Family family = new FamilyAdapter(convert(familyId), clubber);
            clubber.getUpdater().setFamily(family);
        }
        return Optional.of(clubber);
    });
}

[Buggy Hunk]
return Optional.of(clubber);

[Patch]
return Optional.of((Clubber)clubber);