[Demonstration 1]

[Buggy Method]
private BufferedInputStream getStream() {
    if (stream == null) {
        try {
            stream = new BufferedInputStream(new FileInputStream(file));
        } catch (FileNotFoundException e) {
            this.close();
            throw new IllegalStateException("Could not find designated File.", e);
        }
    }
    return stream;
}

[Buggy Hunk]
throw new IllegalStateException("Could not find designated File.", e);

[Patch]
throw new IllegalStateException("Could not open designated File: " + file.getAbsolutePath() + " Reason: " + e.getMessage(), e);

[Demonstration 2]

[Buggy Method]
@Before
public void setUp() {
    folder = new File(getClass().getResource(".").getFile());
    given(activity.getHandler()).willReturn(handler);
    given(activity.getResource(anyInt())).willReturn(TEST);
    given(cameraController.getPreview()).willReturn(preview);
    given(camera.getParameters()).willReturn(params);
    updater = new ParameterUpdater(params);
    shotParams = new ShotParams(preview, activity, updater) {

        @Override
        Context getContext() {
            return context;
        }
    };
    shotParams.setShots(new Shot[] { new Shot("a", 0), new Shot("b", 1) });
    testData = TEST.getBytes();
}

[Buggy Hunk]
shotParams.setShots(new Shot[]{new Shot("a", 0), new Shot("b", 1)});

[Patch]
shotParams.setShots(new Shot[]{new Shot("a"), new Shot("b")});

[Demonstration 3]

[Buggy Method]
@Test
public void failMarkingCurrentHobsAsInterruptedWhenScanIsRunning() throws Exception {
    given(scanService.getStatus()).willReturn(buildScanStatus());
    assertThatThrownBy(() -> scanJobService.markCurrentJobsAsInterrupted()).isInstanceOf(ConcurrentScanException.class);
}

[Buggy Hunk]
given(scanService.getStatus()).willReturn(buildScanStatus());

[Patch]
given(scanner.getStatus()).willReturn(buildScanStatus());