[Demonstration 1]

[Buggy Method]
@Override
public UserDetails loadUserByUsername(String email) throws UsernameNotFoundException {
    if (!this.exists(email)) {
        throw new UsernameNotFoundException("Email " + email + " is not registered");
    }
    User user = userDao.findOne(email).get();
    boolean enabled = true;
    boolean accountNonExpired = true;
    boolean credentialsNotExpired = true;
    boolean accountNonLocked = true;
    String role = user.getUserRole().getName();
    List<GrantedAuthority> listUserRoles = new ArrayList<>();
    listUserRoles.add(new SimpleGrantedAuthority(role));
    return new org.springframework.security.core.userdetails.User(user.getEmail(), user.getPassword(), enabled, accountNonExpired, credentialsNotExpired, accountNonLocked, listUserRoles);
}

[Buggy Hunk]
boolean accountNonLocked = true;

[Patch]
boolean accountNonLocked = ! user.getBlocked();

[Demonstration 2]

[Buggy Method]
@Test
public void testTCO() throws ParseException {
    String input = "def f(n : Int) : Int\n" + "  (n < 0).ifTrue(\n" + "    () => 1,\n" + "    () => f(n-1)\n" + "  )\n" + "f(50000)\n";
    testPyFromInput(input, "1", true);
}

[Buggy Hunk]
testPyFromInput(input, "1", true);

[Patch]
testPyFromInput(input, "1");

[Demonstration 3]

[Buggy Method]
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
    //Change modes if player is shifting
    if (player.isSneaking()) {
        FMLNetworkHandler.openGui(player, Liquislots.INSTANCE, 2, player.worldObj, 0, 0, 0);
        return stack;
    }
    //Get right click position
    MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, true);
    FluidStack result = null;
    ItemStack liquipack = player.inventory.armorItemInSlot(2);
    if (liquipack == null || liquipack.getItem() != ItemsRef.liquipack)
        return stack;
    LiquipackStack tanks = new LiquipackStack(liquipack);
    LiquipackTank tank = tanks.getTank(getSelectedTank(stack));
    if (tank == null) {
        if (!world.isRemote) {
            player.addChatComponentMessage(new ChatComponentText("You don't have any tank in slot " + (getSelectedTank(stack) + 1) + " of your liquipack."));
        }
        return stack;
    }
    if (movingobjectposition != null) {
        if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
            //Store coords in local vars for easy access
            int x = movingobjectposition.blockX;
            int y = movingobjectposition.blockY;
            int z = movingobjectposition.blockZ;
            Block block = world.getBlock(x, y, z);
            //Check if canMineBlock
            if (!world.canMineBlock(player, x, y, z)) {
                return stack;
            }
            boolean shouldPickUp = getMode(stack) == MODE_PICK_UP || (getMode(stack) == MODE_AUTOMATIC && (block instanceof IFluidBlock || block.getMaterial() == Material.lava || block.getMaterial() == Material.water));
            //Drain/Fill mode
            if (shouldPickUp) {
                //Check if canPlayerEdit
                if (!player.canPlayerEdit(x, y, z, movingobjectposition.sideHit, stack)) {
                    return stack;
                }
                //Check if mod fluid found
                if (block instanceof IFluidBlock) {
                    result = new FluidStack(((IFluidBlock) block).getFluid(), FluidContainerRegistry.BUCKET_VOLUME);
                } else {
                    //If its a vannila fluid, handle it
                    Material material = block.getMaterial();
                    int meta = world.getBlockMetadata(x, y, z);
                    if (material == Material.water && meta == 0) {
                        result = new FluidStack(FluidRegistry.WATER, FluidContainerRegistry.BUCKET_VOLUME);
                    }
                    if (material == Material.lava && meta == 0) {
                        result = new FluidStack(FluidRegistry.LAVA, FluidContainerRegistry.BUCKET_VOLUME);
                    }
                }
                if (result != null && tank.fill(result, false) == FluidContainerRegistry.BUCKET_VOLUME) {
                    tank.fill(result, true);
                    tanks.setTank(tank, getSelectedTank(stack));
                    world.setBlockToAir(x, y, z);
                }
            } else {
                //Place handling
                //Get the position for placement
                if (movingobjectposition.sideHit == 0) {
                    --y;
                }
                if (movingobjectposition.sideHit == 1) {
                    ++y;
                }
                if (movingobjectposition.sideHit == 2) {
                    --z;
                }
                if (movingobjectposition.sideHit == 3) {
                    ++z;
                }
                if (movingobjectposition.sideHit == 4) {
                    --x;
                }
                if (movingobjectposition.sideHit == 5) {
                    ++x;
                }
                //Verify canPlayerEdit
                if (!player.canPlayerEdit(x, y, z, movingobjectposition.sideHit, stack)) {
                    return stack;
                }
                //Try to place
                if (tank.drain(FluidContainerRegistry.BUCKET_VOLUME, false) != null && tank.drain(FluidContainerRegistry.BUCKET_VOLUME, false).amount == FluidContainerRegistry.BUCKET_VOLUME && tank.drain(FluidContainerRegistry.BUCKET_VOLUME, false).getFluid().getBlock() != null) {
                    this.tryPlaceContainedLiquid(world, x, y, z, stack, tank.drain(FluidContainerRegistry.BUCKET_VOLUME, true));
                    tanks.setTank(tank, getSelectedTank(stack));
                }
            }
        }
    }
    return stack;
}

[Buggy Hunk]
if(player.isSneaking()){

[Patch]
if(!world.isRemote && player.isSneaking()){