[Demonstration 1]

[Buggy Method]
private static String classNameToJavaFileName(String className) {
    className = className.replace(KoanConstants.PERIOD, DirectoryManager.FILESYSTEM_SEPARATOR);
    if (className.contains(DOLLAR_SIGN)) {
        className = className.substring(0, className.indexOf(DOLLAR_SIGN));
    }
    return className + FileCompiler.JAVA_SUFFIX;
}

[Buggy Hunk]
private static String classNameToJavaFileName(String className) {

[Patch]
public static String classNameToJavaFileName(String className) {

[Demonstration 2]

[Buggy Method]
private WriteMarshallable newSource(long lastIndexReceived) {
    try {
        Class<?> aClass = Class.forName("software.chronicle.enterprise.queue.QueueSourceReplicationHandler");
        Constructor<?> declaredConstructor = aClass.getDeclaredConstructor(long.class);
        return (WriteMarshallable) declaredConstructor.newInstance(lastIndexReceived);
    } catch (Exception e) {
        IllegalStateException licence = new IllegalStateException("A Chronicle Queue Enterprise licence is" + " required to run this code." + "Please contact sales@chronicle.software");
        LOG.error("", e);
        throw licence;
    }
}

[Buggy Hunk]
private WriteMarshallable newSource(long lastIndexReceived) {

[Patch]
public static WriteMarshallable newSource(long lastIndexReceived) {

[Demonstration 3]

[Buggy Method]
@Test
@DisplayName("Constructor throws if end date is before the beginning date")
public void testConstructorInvertedRange() {
    LocalDate now = LocalDate.now();
    assertThrows(IllegalArgumentException.class, () -> new LocalDateRange(now, now.minusDays(1)));
}

[Buggy Hunk]
public void testConstructorInvertedRange() {

[Patch]
public void testConstructorInvertedRange() throws Throwable {