[Demonstration 1]

[Buggy Method]
@Test
public void shouldPopulateRequester() {
    UserProfile facilityProfile = new UserProfile(FACILITY_TYPE, "f100", asList("3026", "4019"));
    UserProfile providerProfile = new UserProfile(PROVIDER_TYPE, "p100", asList("1001"));
    UserProfile adminProfile = new UserProfile(ADMIN_TYPE, "a100", asList("2020"));
    UserInfo userInfo = new UserInfo("102", "ABC", "abc@mail", 1, true, "111100", new ArrayList<>(asList(MCI_USER_GROUP)), asList(adminProfile, providerProfile, facilityProfile));
    PatientData patient = new PatientData();
    patient.setProviderUrl("p000");
    patient.setRequester(userInfo.getProperties());
    Requester requester = patient.getRequester();
    assertNotNull(requester);
    RequesterDetails provider = requester.getProvider();
    assertNotNull(provider);
    assertEquals("p100", provider.getId());
    assertNull(provider.getName());
    RequesterDetails facility = requester.getFacility();
    assertNotNull(facility);
    assertEquals("f100", facility.getId());
    assertNull(facility.getName());
}

[Buggy Hunk]
patient.setProviderUrl("p000");

[Patch]
patient.setProvider("p000");

[Demonstration 2]

[Buggy Method]
public void handleMessage(ConsistencyMessage cm) {
    this.message = cm;
    check();
}

[Buggy Hunk]
check();

[Patch]
check(cm.vm, cm.vm.valid.get(0));

[Demonstration 3]

[Buggy Method]
@Test
public void testNodes() throws InterruptedException {
    final GenericMove[] bestMove = { null };
    final GenericMove[] ponderMove = { null };
    final long[] nodes = { 0 };
    final Semaphore semaphore = new Semaphore(0);
    // Test if we can search only 1 node
    commands.add(new EngineAnalyzeCommand(new GenericBoard(GenericBoard.STANDARDSETUP), Arrays.asList(new GenericMove(GenericPosition.c2, GenericPosition.c4))));
    EngineStartCalculatingCommand command = new EngineStartCalculatingCommand();
    command.setNodes(1L);
    commands.add(command);
    new Pulse(new ProtocolHandler() {

        @Override
        public void send(ProtocolBestMoveCommand command) {
            super.send(command);
            bestMove[0] = command.bestMove;
            ponderMove[0] = command.ponderMove;
            semaphore.release();
        }

        @Override
        public void send(ProtocolInformationCommand command) {
            super.send(command);
            if (command.getNodes() != null) {
                nodes[0] = command.getNodes();
            }
        }
    }).run();
    assertThat(semaphore.tryAcquire(10000, MILLISECONDS), is(true));
    assertThat(bestMove[0], is(notNullValue()));
    assertThat(ponderMove[0], is(nullValue()));
    assertThat(nodes[0], is(1L));
}

[Buggy Hunk]
Arrays.asList(new GenericMove(GenericPosition.c2, GenericPosition.c4))));

[Patch]
singletonList(new GenericMove(GenericPosition.c2, GenericPosition.c4))));