[Demonstration 1]

[Buggy Method]
public void populateVotes(Set<Vote> votes) {
    for (Person person : _personCache) {
        Optional<Vote> vote1 = votes.stream().filter(v -> v.getPersonKey() == person.getPersonKey()).filter(v -> v.getVoteNumber() == 1).findFirst();
        Optional<Vote> vote2 = votes.stream().filter(v -> v.getPersonKey() == person.getPersonKey()).filter(v -> v.getVoteNumber() == 2).findFirst();
        Optional<Vote> vote3 = votes.stream().filter(v -> v.getPersonKey() == person.getPersonKey()).filter(v -> v.getVoteNumber() == 3).findFirst();
        vote1.ifPresent(v -> person.setGameVote1(_lanoelGameCache.stream().filter(g -> g.getGameKey() == vote1.get().getGameKey()).findFirst().get().getGameName()));
        vote2.ifPresent(v -> person.setGameVote2(_lanoelGameCache.stream().filter(g -> g.getGameKey() == vote2.get().getGameKey()).findFirst().get().getGameName()));
        vote3.ifPresent(v -> person.setGameVote3(_lanoelGameCache.stream().filter(g -> g.getGameKey() == vote3.get().getGameKey()).findFirst().get().getGameName()));
    }
    for (Game game : _lanoelGameCache) {
        game.setVoteTotal(0);
        Stream<Vote> votesForGame = votes.stream().filter(v -> v.getGameKey() == game.getGameKey());
        votesForGame.forEach(v -> game.setVoteTotal(game.getVoteTotal() + v.getVoteNumber()));
    }
}

[Buggy Hunk]
public void populateVotes(Set<Vote> votes)

[Patch]
private void populateVotes(Set<Vote> votes)

[Demonstration 2]

[Buggy Method]
public InetAddress firstConnect() {
    try {
        Socket socket = sSocket.accept();
        ObjectInputStream objectInputStream = new ObjectInputStream(client.getInputStream());
        try {
            Object object = objectInputStream.readObject();
            if (object.getClass().equals(String.class)) {
                return socket.getInetAddress();
            }
        } catch (ClassNotFoundException f) {
            Log.d(TAG, f.toString());
        }
    } catch (java.io.IOException e) {
        Log.d(TAG, e.toString());
    }
    return null;
}

[Buggy Hunk]
ObjectInputStream objectInputStream = new ObjectInputStream(client.getInputStream());

[Patch]
ObjectInputStream objectInputStream = new ObjectInputStream(socket.getInputStream());

[Demonstration 3]

[Buggy Method]
private void getPhotos(JSONArray args, final CallbackContext callbackContext) throws JSONException {
    final CordovaWebView webView = this.webView;
    cordova.getThreadPool().execute(new Runnable() {

        @Override
        public void run() {
            // We discover every video / photo stored on the phone and ask the _data field, which is the full
            // path of the file
            discover(MediaStore.Video.Media.query(webView.getContext().getContentResolver(), MediaStore.Video.Media.EXTERNAL_CONTENT_URI, new String[] { MediaStore.Video.Media.DATA }, null, null, MediaStore.Video.Media.DATE_MODIFIED + " ASC"));
            discover(MediaStore.Images.Media.query(webView.getContext().getContentResolver(), MediaStore.Images.Media.EXTERNAL_CONTENT_URI, new String[] { MediaStore.Images.Media.DATA }, null, null, MediaStore.Images.Media.DATE_MODIFIED + " ASC"));
        }

        public discover(Cursor cursor) {
            while (cursor.moveToNext()) {
                for (int i = 0; i < cursor.getColumnCount(); i++) {
                    if (cursor.getColumnName(i).equals("_data")) {
                        Log.d(TAG, "Discovering " + cursor.getString(i));
                        // The callbackContext.success() method can only be called once
                        PluginResult result = new PluginResult(PluginResult.Status.OK, cursor.getString(i));
                        result.setKeepCallback(true);
                        callbackContext.sendPluginResult(result);
                    }
                }
            }
        }
    });
}

[Buggy Hunk]
public discover(Cursor cursor) {

[Patch]
private void discover(Cursor cursor) {