[Demonstration 1]

[Buggy Method]
private void showPicture() {
    if (!mPictureFile.exists()) {
        return;
    }
    BitmapFactory.Options option = new BitmapFactory.Options();
    option.inJustDecodeBounds = true;
    BitmapFactory.decodeFile(mPictureFile.getAbsolutePath(), option);
    option.inSampleSize = CameraUtil.calculateInSampleSize(option, mPictureIv.getMeasuredWidth(), mPictureIv.getMeasuredHeight());
    option.inJustDecodeBounds = false;
    mPictureIv.setImageBitmap(BitmapFactory.decodeFile(mPictureFile.getAbsolutePath(), option));
    //        try {
    ////            MediaStore.Images.Media.insertImage(getContentResolver(), mPictureFile.getAbsolutePath(), "ExCamera", null);
    //        } catch (FileNotFoundException e) {
    //            e.printStackTrace();
    //        }
    Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse("file://" + mPictureFile.getAbsolutePath()));
    sendBroadcast(intent);
}

[Buggy Hunk]
if (!mPictureFile.exists()) {

[Patch]
if (mPictureFile == null || !mPictureFile.exists()) {

[Demonstration 2]

[Buggy Method]
public void sort(final int[] array) {
    int[] tempArray = new int[array.length];
    System.arraycopy(array, 0, tempArray, 0, array.length);
    final long startTime = System.currentTimeMillis();
    mergeSort(tempArray);
    runtimeMilliseconds = (int) (System.currentTimeMillis() - startTime);
}

[Buggy Hunk]
runtimeMilliseconds = (int) (System.currentTimeMillis() - startTime);

[Patch]
runtimeMilliseconds = System.currentTimeMillis() - startTime;

[Demonstration 3]

[Buggy Method]
public BigDecimal getETA() {
    BigDecimal totalPers = new BigDecimal(totalPermutations);
    double startTime = System.currentTimeMillis();
    for (double i = 0; i < 1.79769313486231570E+6; i++) {
        if ("abcdqewadvavfdsbffbdfgnhfjgdntyutdcbtfynbsv".equals("vndalisvdavdadbfddsfbadfdvnvlfa")) {
            //Random Comparison between two strings.
        }
    }
    double endTime = System.currentTimeMillis();
    Double sampleTimeElapsed = endTime - startTime;
    BigDecimal retVal = new BigDecimal("1");
    BigDecimal ste = new BigDecimal(sampleTimeElapsed.toString());
    ste = ste.divide(new BigDecimal("1.79769313486231570E+6"), 1000, RoundingMode.HALF_UP);
    retVal = totalPers.multiply(ste);
    return retVal;
}

[Buggy Hunk]
retVal = totalPers.multiply(ste);

[Patch]
retVal = totalPers.multiply(ste).multiply(new BigDecimal("10000"));