if (permanent != null) {
permanent.sacrifice(source.getSourceId(), game);
if (filterGoblin.match(permanent, game)) {
for (int i = 0; i < 2; i++) {
Token token = new WarrenWeirdingBlackGoblinRogueToken();
Effect effect = new CreateTokenTargetEffect(token);
effect.setTargetPointer(new FixedTarget(player.getId()));
if (effect.apply(game, source)) {
Permanent tokenPermanent = game.getPermanent(token.getLastAddedToken());
if (tokenPermanent != null) {
ContinuousEffect hasteEffect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
hasteEffect.setTargetPointer(new FixedTarget(tokenPermanent.getId()));
game.addEffect(hasteEffect, source);