[Demonstration 1]

[Buggy Method]
@SubscribeEvent
public void playerUpdate(LivingUpdateEvent event) {
    if (event.getEntityLiving() instanceof EntityPlayer && !event.getEntity().worldObj.isRemote) {
        EntityPlayer player = (EntityPlayer) event.getEntityLiving();
        NBTTagCompound data = player.getEntityData();
        if (!data.hasKey(EntityPlayer.PERSISTED_NBT_TAG))
            data.setTag(EntityPlayer.PERSISTED_NBT_TAG, new NBTTagCompound());
        NBTTagCompound persist = data.getCompoundTag(EntityPlayer.PERSISTED_NBT_TAG);
        if (player.ticksExisted > 3 && !persist.getBoolean("worldCreated")) {
            World world = player.worldObj;
            if (world.getWorldInfo().getTerrainType() instanceof WorldTypeSky) {
                BlockPos spawn = world.getSpawnPoint();
                for (int i = 0; i < 6; i++) {
                    if (world.getBlockState(spawn.down(i)) == Blocks.bedrock && world.provider.getDimension() == 0)
                        return;
                }
                spawnPlayer(player, spawn);
            }
            persist.setBoolean("worldCreated", true);
        }
    }
}

[Buggy Hunk]
if (world.getBlockState(spawn.down(i)) == Blocks.bedrock

[Patch]
if (world.getBlockState(spawn.down(i)) == Blocks.bedrock.getDefaultState()

[Demonstration 2]

[Buggy Method]
public boolean isPlaying() {
    return player != null && player.isPlaying();
}

[Buggy Hunk]
return player != null && player.isPlaying();

[Patch]
return isPlaying;

[Demonstration 3]

[Buggy Method]
@Test
public void testValidateForCreate_shouldAcceptInvoice() throws ValidationException {
    Invoice invoice = new Invoice();
    invoice.setTime(LocalDateTime.now());
    invoice.setGross(new BigDecimal("23"));
    invoice.setCreator(new User());
    invoiceValidator.validateForCreate(invoice);
}

[Buggy Hunk]
invoice.setCreator(new User());

[Patch]
invoice.setCreator(User.withIdentity("TestUser"));