[Demonstration 1]

[Buggy Method]
public static boolean authorize(Context context, Account account) {
    // make sure the SDK is initialized
    FacebookSdk.sdkInitialize(context);
    if (isExtendingToken || !DeviceUtil.isOnline(context)) {
        return false;
    }
    // TODO Evaluate if removing the workaround code would have any adverse effects on the code
    //        DeviceUtil.showJellyBeanNotification(context);
    AccessToken accessToken = AccessToken.getCurrentAccessToken();
    if (accessToken.isExpired()) {
        notifyToken(context);
        return false;
    }
    return true;
}

[Buggy Hunk]
if (accessToken.isExpired()) {

[Patch]
if (accessToken == null || accessToken.isExpired()) {

[Demonstration 2]

[Buggy Method]
private String valueOf(Object object) {
    if (object == null) {
        throw new RuntimeException("Can't save null");
    } else if (object instanceof Date) {
        Date date = (Date) object;
        return String.valueOf(date.getTime());
    } else if (object instanceof Enum) {
        throw new RuntimeException("That is not the right way to save an enum...");
    } else {
        return String.valueOf(object);
    }
}

[Buggy Hunk]
throw new RuntimeException("That is not the right way to save an enum...");

[Patch]
return ((Enum)object).name();

[Demonstration 3]

[Buggy Method]
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_setup);
    if (!hasCamera()) {
        View qrCodeLayout = findViewById(R.id.qr_code_layout);
        qrCodeLayout.setVisibility(View.INVISIBLE);
    }
}

[Buggy Hunk]
qrCodeLayout.setVisibility(View.INVISIBLE);

[Patch]
qrCodeLayout.setVisibility(View.GONE);