[Demonstration 1]

[Buggy Method]
private void processChannelMessages(Map<String, List<ChatMessage>> userMessages) {
    for (Map.Entry<String, List<ChatMessage>> entry : userMessages.entrySet()) {
        final String channel = entry.getKey();
        final List<ChatMessage> messages = entry.getValue();
        String address = verticle.generateChannelAddress(channel);
        for (ChatMessage chatMessage : messages) {
            verticle.eventBus.publish(address, chatMessage);
        }
        verticle.sharedDataService.getMessageMap((mapResult) -> {
            if (mapResult.succeeded()) {
                final AsyncMap<String, JsonArray> map = mapResult.result();
                map.get(channel, (result) -> {
                    List<JsonObject> list;
                    if (result.succeeded()) {
                        //noinspection unchecked
                        list = result.result().getList();
                    } else {
                        list = new ArrayList<>();
                    }
                    for (ChatMessage message : messages) {
                        list.add(ChatMessageCodec.INSTANCE.toJson(message));
                    }
                    if (list.size() > MAX_CHANNEL_HISTORY) {
                        list = list.subList(list.size() - MAX_CHANNEL_HISTORY, list.size());
                    }
                    map.put(channel, new JsonArray(list), null);
                });
            } else {
                log.log(Level.WARNING, "Error getting message-map", mapResult.cause());
            }
        });
    }
}

[Buggy Hunk]
if (result.succeeded()) {

[Patch]
if (result.succeeded() && result.result() != null) {

[Demonstration 2]

[Buggy Method]
private void readDictionaryBatches() throws JsonParseException, IOException {
    readToken(START_ARRAY);
    JsonToken token = parser.nextToken();
    boolean haveDictionaryBatch = token == START_OBJECT;
    while (haveDictionaryBatch) {
        // Lookup what dictionary for the batch about to be read
        long id = readNextField("id", Long.class);
        Dictionary dict = dictionaries.get(id);
        if (dict == null) {
            throw new IllegalArgumentException("Dictionary with id: " + id + " missing encoding from schema Field");
        }
        // Read the dictionary record batch
        nextFieldIs("data");
        FieldVector vector = dict.getVector();
        List<Field> fields = ImmutableList.of(vector.getField());
        List<FieldVector> vectors = ImmutableList.of(vector);
        VectorSchemaRoot root = new VectorSchemaRoot(fields, vectors, vector.getAccessor().getValueCount());
        read(root);
        readToken(END_OBJECT);
        token = parser.nextToken();
        haveDictionaryBatch = token == START_OBJECT;
    }
    if (token != END_ARRAY) {
        throw new IllegalArgumentException("Invalid token: " + token);
    }
}

[Buggy Hunk]
throw new IllegalArgumentException("Invalid token: " + token);

[Patch]
throw new IllegalArgumentException("Invalid token: " + token + " expected end of array at " + parser.getTokenLocation());

[Demonstration 3]

[Buggy Method]
@Override
public void onMyLocationChange(Location location) {
    if (!mAnimatedToMyPosition) {
        CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(new LatLng(location.getLatitude(), location.getLongitude()), 16);
        mMap.moveCamera(cameraUpdate);
        mAnimatedToMyPosition = true;
        mMap.setOnMyLocationChangeListener(null);
    }
}

[Buggy Hunk]
if (!mAnimatedToMyPosition) {

[Patch]
if (!mAnimatedToMyPosition && mMap != null) {