[Demonstration 1]

[Buggy Method]
private void transformConstant(SingleLineError error, List<String> contents) {
    // Get indices to underline
    int openingSpanIndex = error.getOpeningUnderlineIndex();
    int closingSpanIndex = error.getClosingUnderlineIndex();
    // Get line contents to update
    String lineText = contents.get(error.getLineNumber() - 1);
    // Split string into three pieces to insert underline html into
    String start = lineText.substring(0, openingSpanIndex);
    String middle = lineText.substring(openingSpanIndex, closingSpanIndex);
    String end = lineText.substring(closingSpanIndex);
    String newLineText = start + CONSTANT_OPENING_SPAN + middle + CLOSING_SPAN + end;
    if (!error.getErrorType().equals("LineLength")) {
        contents.set(error.getLineNumber() - 1, newLineText);
    }
}

[Buggy Hunk]
String newLineText = start + CONSTANT_OPENING_SPAN + middle + CLOSING_SPAN + end;

[Patch]
String newLineText = start + OPENING_SPAN + error.getErrorType() + OPENING_SPAN_CLOSE + middle + CLOSING_SPAN + end;

[Demonstration 2]

[Buggy Method]
@Test
public void shouldBuild() {
    final JoalConfigProvider configProvider = Mockito.mock(JoalConfigProvider.class);
    final AppConfiguration conf = Mockito.mock(AppConfiguration.class);
    Mockito.when(configProvider.get()).thenReturn(conf);
    Mockito.when(conf.getSimultaneousSeed()).thenReturn(3);
    try {
        final BandwidthDispatcher bandwidthDispatcher = new BandwidthDispatcher(configProvider);
    } catch (final Throwable throwable) {
        fail("should build", throwable);
    }
}

[Buggy Hunk]
final BandwidthDispatcher bandwidthDispatcher = new BandwidthDispatcher(configProvider);

[Patch]
new BandwidthDispatcher(configProvider);

[Demonstration 3]

[Buggy Method]
@Override
protected Class<?>[] getRootConfigClasses() {
    return null;
}

[Buggy Hunk]
return null;

[Patch]
return new Class[]{Object.class};