[Demonstration 1]

[Buggy Method]
private static Visit<Tile> tilesUnder(PropType type, final Scene scene, final int x, final int y, final int facing) {
    final int w = Nums.max(1, type.wide()), h = Nums.max(1, type.high());
    final Visit<Coord> base = Visit.grid(0, 0, w, h, 1);
    return new Visit<Tile>() {

        public boolean hasNext() {
            return base.hasNext();
        }

        public Tile next() {
            Coord c = translate(base.next(), facing, false);
            return scene.tileAt(c.x + x, c.y + y);
        }
    };
}

[Buggy Hunk]
Coord c = translate(base.next(), facing, false);

[Patch]
Coord c = rotate(base.next(), facing, false);

[Demonstration 2]

[Buggy Method]
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_detail_grocery_list);
    Button add_item = (Button) findViewById(R.id.add_item);
    final EditText title = (EditText) findViewById(R.id.groceries_list_title);
    //Handling When it Comes from notification!
    if (getIntent().getStringExtra("list_ref") != null) {
        SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
        SharedPreferences.Editor edit = sp.edit();
        edit.putInt("from_notif", 1);
        edit.commit();
        final DatabaseReference notificatonRef = FirebaseDatabase.getInstance().getReferenceFromUrl(getIntent().getStringExtra("list_ref").toString());
        title.setEnabled(false);
        notificatonRef.child("title").addValueEventListener(new ValueEventListener() {

            @Override
            public void onDataChange(DataSnapshot dataSnapshot) {
                if (dataSnapshot.exists()) {
                    title.setText(dataSnapshot.getValue().toString());
                }
            }

            @Override
            public void onCancelled(DatabaseError databaseError) {
            }
        });
        add_item.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View view) {
                notificatonRef.child("items").push().child("itemname").setValue("");
                mGroceryAdapter.notifyDataSetChanged();
            }
        });
        linearLayoutManager = new LinearLayoutManager(this);
        groceryRecyclerview = (RecyclerView) findViewById(R.id.grocery_recycler_view);
        groceryRecyclerview.setHasFixedSize(true);
        childRef = notificatonRef.child("items");
        childRef.keepSynced(true);
        mGroceryAdapter = new GroceryAdapter(GroceryObject.class, R.layout.grocery_ui, GroceryHolder.class, childRef, getApplicationContext());
        mGroceryAdapter.notifyDataSetChanged();
        groceryRecyclerview.setLayoutManager(linearLayoutManager);
        groceryRecyclerview.setAdapter(mGroceryAdapter);
    } else {
        SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
        SharedPreferences.Editor edit = sp.edit();
        edit.putInt("from_notif", 2);
        edit.commit();
        listRef = FirebaseDatabase.getInstance().getReference().child("Users").child(getUserId()).child(PersonalGroceryList.ListCategory.toString());
        if (getIntent().getStringExtra("list_id") != null) {
            pushid = getIntent().getStringExtra("list_id").toString();
        } else {
            pushid = listRef.push().getKey();
        }
        title.setOnFocusChangeListener(new View.OnFocusChangeListener() {

            @Override
            public void onFocusChange(View view, boolean b) {
                if (!b) {
                    listRef.child(pushid).child("title").setValue(title.getText().toString());
                }
            }
        });
        listRef.child(pushid).child("title").addValueEventListener(new ValueEventListener() {

            @Override
            public void onDataChange(DataSnapshot dataSnapshot) {
                if (dataSnapshot.exists()) {
                    title.setText(dataSnapshot.getValue().toString());
                }
            }

            @Override
            public void onCancelled(DatabaseError databaseError) {
            }
        });
        add_item.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View view) {
                listRef.child(pushid).child("items").push().child("itemname").setValue("");
                mGroceryAdapter.notifyDataSetChanged();
            }
        });
        linearLayoutManager = new LinearLayoutManager(this);
        groceryRecyclerview = (RecyclerView) findViewById(R.id.grocery_recycler_view);
        groceryRecyclerview.setHasFixedSize(true);
        mDatabaseRef = FirebaseDatabase.getInstance().getReference();
        childRef = mDatabaseRef.child("Users").child(getUserId()).child(PersonalGroceryList.ListCategory.toString()).child(pushid).child("items");
        childRef.keepSynced(true);
        mGroceryAdapter = new GroceryAdapter(GroceryObject.class, R.layout.grocery_ui, GroceryHolder.class, childRef, getApplicationContext());
        groceryRecyclerview.setLayoutManager(linearLayoutManager);
        groceryRecyclerview.setAdapter(mGroceryAdapter);
        Toast.makeText(this, "Loaded", Toast.LENGTH_SHORT).show();
    }
}

[Buggy Hunk]
notificatonRef.child("items").push().child("itemname").setValue("");

[Patch]
notificatonRef.child("items").child(getUserId()+"_"+notificatonRef.push().getKey().toString()).child("itemname").setValue("");

[Demonstration 3]

[Buggy Method]
private String performHTTPSPostConnection(SSLContext sslContext, String url, String request) {
    //init https connection and jsonResponse object
    Log.d("INFO", "Performing HTTP POST Connection - " + url);
    HttpsURLConnection httpsURLConnection = null;
    try {
        //init local variables
        String result = null;
        URL requestedUrl = new URL(url);
        //init https connection and return resposne
        httpsURLConnection = (HttpsURLConnection) requestedUrl.openConnection();
        httpsURLConnection.setRequestProperty("Content-Type", "application/json");
        httpsURLConnection.setHostnameVerifier(new HostnameVerifier() {

            @Override
            public boolean verify(String hostname, SSLSession session) {
                Log.d("INFO", "Adding hosting verification");
                HostnameVerifier hv = HttpsURLConnection.getDefaultHostnameVerifier();
                //return hv.verify(rHostName, session);
                return true;
            }
        });
        httpsURLConnection.setSSLSocketFactory(sslContext.getSocketFactory());
        //check for the authorization String
        if (this.rAuthorization != "") {
            Log.d("INFO", "Adding token to header");
            httpsURLConnection.setRequestProperty("Authorization", "Bearer " + this.rAuthorization);
        }
        httpsURLConnection.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)");
        httpsURLConnection.setAllowUserInteraction(true);
        httpsURLConnection.setUseCaches(false);
        httpsURLConnection.setRequestMethod("POST");
        httpsURLConnection.setConnectTimeout(1 * 60 * 1000);
        httpsURLConnection.setDoOutput(true);
        httpsURLConnection.setDoInput(true);
        //write the data to the server
        Log.d("INFO", "Writing POST body to stream");
        //OutputStream os = httpsURLConnection.getOutputStream();
        DataOutputStream out = new DataOutputStream(httpsURLConnection.getOutputStream());
        out.write(request.getBytes());
        out.close();
        //init connection
        httpsURLConnection.connect();
        //returm the data
        String responseString = parseResponseStream(httpsURLConnection.getInputStream());
        Log.d("INFO", "Returning response from POST request - " + responseString);
        return parseResponseStream(httpsURLConnection.getInputStream());
    } catch (Exception ex) {
        Log.d("INFO", ex.toString());
        return ex.toString();
    } finally {
        //check if the connection is not null and close
        if (httpsURLConnection != null) {
            httpsURLConnection.disconnect();
        }
    }
}

[Buggy Hunk]
return parseResponseStream(httpsURLConnection.getInputStream());

[Patch]
return responseString;