FilterPermanent filter = new FilterPermanent();
filter.add(new CardTypePredicate(type));
if(choiceImpl.getChoice().equals("Untap")){
filter.add(new TappedPredicate());
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
if(permanent.getControllerId().equals(target)){
permanent.untap(game);
}
}
}
else{
filter.add(Predicates.not(new TappedPredicate()));
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
if(permanent.getControllerId().equals(target)){
permanent.tap(game);
}
}