[Demonstration 1]

[Buggy Method]
@Override
public String getType(Uri uri) {
    switch(sUriMatcher.match(uri)) {
        case INCOMING_POINT_COLLECTION_URI_INDICATOR:
            return DayPointsProviderMetadata.DayPointsTableMetadata.CONTENT_TYPE;
        case INCOMING_SINGLE_POINT_URI_INDICATOR:
            return DayPointsProviderMetadata.DayPointsTableMetadata.CONTENT_ITEM_TYPE;
        case INCOMING_DAYS_COLLECTION_URI_INDICATOR:
            return DayPointsProviderMetadata.DayPointsTableMetadata.CONTENT_DAYS_TYPE;
        default:
            throw new IllegalArgumentException("Unknown uri " + uri);
    }
}

[Buggy Hunk]
public String getType(Uri uri) {

[Patch]
public String getType(@NonNull Uri uri) {

[Demonstration 2]

[Buggy Method]
private void handleChooserResult(int resultCode, Intent intent) {
    if (mCallback == null) {
        LOG.w(TAG, "No callback for chooser result");
        return;
    }
    if (resultCode == Activity.RESULT_OK) {
        DbxChooser.Result result = new DbxChooser.Result(intent);
        JSONObject file = new JSONObject();
        file.put("name", result.getName());
        file.put("link", result.getLink().toString());
        file.put("bytes", result.getSize());
        file.put("icon", result.getIcon().toString());
        Map<String, Uri> thumbnailMap = result.getThumbnails();
        JSONObject thumbnail = new JSONObject();
        if (thumbnailMap != null) {
            for (Map.Entry<String, Uri> entry : result.getThumbnails().entrySet()) {
                thumbnail.put(entry.getKey(), entry.getValue().toString());
            }
        }
        file.put("thumbnail", thumbnail);
        JSONArray files = new JSONArray();
        files.put(file);
        callback.success(files);
    } else {
        callback.error();
    }
}

[Buggy Hunk]
for (Map.Entry<String, Uri> entry : result.getThumbnails().entrySet()) {

[Patch]
for (Map.Entry<String, Uri> entry : thumbnailMap.entrySet()) {