[Demonstration 1]

[Buggy Method]
public void setLeftArm(String leftArm) {
    this.leftArm = leftArm;
    if (leftArm == ("")) {
        return;
    }
    mMeasurement.setLeftArm(Double.parseDouble(leftArm));
    notifyPropertyChanged(BR.leftArm);
}

[Buggy Hunk]
if (leftArm == ("")) {

[Patch]
if (Objects.equals(leftArm, "")) {

[Demonstration 2]

[Buggy Method]
@Test
public void s3Test() throws Exception {
    // Create a real object and mock its initClient method
    final S3NutDao dao = spy(new S3NutDao("/path", false, null, -1, "wuic", "login", "pwd", false, false, true, null));
    // Build client mock
    final AmazonS3Client client = mock(AmazonS3Client.class);
    final ObjectMetadata metadata = mock(ObjectMetadata.class);
    when(metadata.getLastModified()).thenReturn(new Date());
    when(client.getObjectMetadata(anyString(), anyString())).thenReturn(metadata);
    when(dao.initClient()).thenReturn(client);
    // List returned by client
    final ObjectListing list = mock(ObjectListing.class);
    final S3ObjectSummary summary = mock(S3ObjectSummary.class);
    when(summary.getKey()).thenReturn("[cloud].css");
    final S3ObjectSummary summarBis = mock(S3ObjectSummary.class);
    when(summarBis.getKey()).thenReturn("cloud.css");
    when(client.listObjects(any(ListObjectsRequest.class))).thenReturn(list);
    when(list.getObjectSummaries()).thenReturn(Arrays.asList(summary, summarBis));
    // Bytes returned by mocked S3
    final byte[] array = ".cloud { text-align : justify;}".getBytes();
    final S3Object object = mock(S3Object.class);
    when(object.getObjectContent()).thenReturn(new S3ObjectInputStream(new ByteArrayInputStream(array), null));
    when(client.getObject(anyString(), anyString())).thenReturn(object);
    // TODO : problem here : we specify '[cloud.css]' but getNuts() returns 'cloud.css' because regex are always activated !
    final NutsHeap nutsHeap = new NutsHeap(this, Arrays.asList("[cloud].css"), dao, "heap");
    nutsHeap.checkFiles(null);
    Assert.assertEquals(nutsHeap.getNuts().size(), 1);
    final NodeEngine aggregator = new TextAggregatorEngine(true, true);
    final List<ConvertibleNut> group = aggregator.parse(new EngineRequestBuilder("", nutsHeap).build());
    Assert.assertFalse(group.isEmpty());
    InputStream is;
    for (final Nut res : group) {
        is = res.openStream();
        Assert.assertTrue(IOUtils.readString(new InputStreamReader(is)).length() > 0);
        is.close();
    }
}

[Buggy Hunk]
final List<ConvertibleNut> group = aggregator.parse(new EngineRequestBuilder("", nutsHeap).build());

[Patch]
final List<ConvertibleNut> group = aggregator.parse(new EngineRequestBuilder("", nutsHeap, null).build());