[Demonstration 1]

[Buggy Method]
@Override
public void readFromNBT(NBTTagCompound nbtTagCompound) {
    super.readFromNBT(nbtTagCompound);
    // Read in the ItemStacks in the inventory from NBT
    NBTTagList tagList = nbtTagCompound.getTagList(Names.NBT.ITEMS, 10);
    vatItemStacks = new ItemStack[this.getSizeInventory()];
    for (int i = 0; i < tagList.tagCount(); ++i) {
        NBTTagCompound tagCompound = tagList.getCompoundTagAt(i);
        byte slotIndex = tagCompound.getByte("Slot");
        if (slotIndex >= 0 && slotIndex < vatItemStacks.length) {
            vatItemStacks[slotIndex] = ItemStack.loadItemStackFromNBT(tagCompound);
        }
    }
    currentWaste.readFromNBT(nbtTagCompound);
}

[Buggy Hunk]
currentWaste.readFromNBT(nbtTagCompound);

[Patch]
tank.readFromNBT(nbtTagCompound);

[Demonstration 2]

[Buggy Method]
private void checkBounds() {
    if (position.x < 0)
        position.x = 0;
    if (position.x > 1000)
        position.x = 0;
    if (position.y < 10)
        position.y = 10;
    if (position.z > 0)
        position.z = 0;
    if (position.z < -1000)
        position.z = -1000;
}

[Buggy Hunk]
if (position.x > 1000) position.x = 0;

[Patch]
if (position.x > 1000) position.x = 1000;

[Demonstration 3]

[Buggy Method]
@Override
public boolean isItemValidForSlot(int slot, ItemStack stack) {
    return slot < getSizeInventory() && isValid(stack);
}

[Buggy Hunk]
return slot < getSizeInventory() && isValid(stack);

[Patch]
return slot >= 0 && slot < getSizeInventory() && isValid(stack);