[Demonstration 1]

[Buggy Method]
private void onManagersInitialization() {
    MMXManager.getInstance(this);
    SharedPreferenceManager.getInstance(this);
    InternetConnectionManager.getInstance(this);
    ChannelCacheManager.getInstance();
}

[Buggy Hunk]
MMXManager.getInstance(this);

[Patch]
ChatSDK.init(this);

[Demonstration 2]

[Buggy Method]
@Override
public void onValidationSucceeded() {
    _loginButton.setEnabled(false);
    final ProgressDialog progressDialog = new ProgressDialog(Login.this, R.style.AppTheme_Dark_Dialog);
    progressDialog.setIndeterminate(true);
    progressDialog.setMessage("Authenticating...");
    progressDialog.show();
    String email = _emailText.getText().toString();
    String password = _passwordText.getText().toString();
    ArrayList scope = new ArrayList();
    scope.add("all_all");
    UserAuth user = new UserAuth(email, password, scope, "AGENT_CONSOLE", "e8ea7bb0-5026-11e7-a69b-b153a7c332b9");
    Call<UserAuthResponse> call1 = apiInterface.authenticate(user);
    call1.enqueue(new Callback() {

        @Override
        public void onResponse(Call call, Response response) {
            if (response.isSuccessful() && response.body() instanceof UserAuthResponse) {
                UserAuthResponse userAuthResponse = (UserAuthResponse) response.body();
                progressDialog.dismiss();
                Log.d(TAG, userAuthResponse.getToken());
                sessionManager.createLoginSession("", userAuthResponse.getToken());
                onLoginSuccess();
            } else {
                String message = "Invalid email and/or password";
                try {
                    Log.d(TAG, response.errorBody().string());
                } catch (IOException e) {
                    e.printStackTrace();
                }
                progressDialog.dismiss();
                onLoginFailed(message);
            }
        }

        @Override
        public void onFailure(Call call, Throwable t) {
            call.cancel();
        }
    });
}

[Buggy Hunk]
call1.enqueue(new Callback() {

[Patch]
call1.enqueue(new Callback<UserAuthResponse>() {

[Demonstration 3]

[Buggy Method]
@Override
public boolean belongsToCurrentProject() {
    return AdminSettings.getInstance().getProjectId() != null && mProjectId.equals(AdminSettings.getInstance().getProjectId());
}

[Buggy Hunk]
return AdminSettings.getInstance().getProjectId() != null && mProjectId.equals(AdminSettings.getInstance().getProjectId());

[Patch]
return AdminSettings.getInstance().getProjectId() != null && mProjectId != null && mProjectId.equals(AdminSettings.getInstance().getProjectId());