list.size > 0 changed to !list.isEmpty

We care about if it's empty or not, not about it's size
This commit is contained in:
vraskulin 2017-01-27 16:04:56 +03:00
parent f60ebfbb1f
commit 0557b5e89c
366 changed files with 532 additions and 548 deletions

View file

@ -33,7 +33,7 @@ public class HeavyArbalestTest extends CardTestPlayerBase {
assertLife(playerB, 18);
Permanent eliteVanguard = getPermanent("Elite Vanguard", playerA.getId());
Assert.assertTrue(eliteVanguard.getAttachments().size() > 0);
Assert.assertTrue(!eliteVanguard.getAttachments().isEmpty());
Assert.assertTrue(eliteVanguard.isTapped());
}

View file

@ -125,7 +125,7 @@ public class RandomPlayer extends ComputerPlayer {
ability = options.get(rnd.nextInt(options.size()));
}
}
if (ability.getManaCosts().getVariableCosts().size() > 0) {
if (!ability.getManaCosts().getVariableCosts().isEmpty()) {
int amount = getAvailableManaProducers(game).size() - ability.getManaCosts().convertedManaCost();
if (amount > 0) {
ability = ability.copy();
@ -225,7 +225,7 @@ public class RandomPlayer extends ComputerPlayer {
int check = rnd.nextInt(numGroups + 1);
if (check < numGroups) {
CombatGroup group = game.getCombat().getGroups().get(check);
if (group.getAttackers().size() > 0) {
if (!group.getAttackers().isEmpty()) {
this.declareBlocker(this.getId(), blocker.getId(), group.getAttackers().get(0), game);
}
}

View file

@ -175,7 +175,7 @@ public class TestPlayer implements Player {
protected Permanent findPermanent(FilterPermanent filter, UUID controllerId, Game game) {
List<Permanent> permanents = game.getBattlefield().getAllActivePermanents(filter, controllerId, game);
if (permanents.size() > 0) {
if (!permanents.isEmpty()) {
return permanents.get(0);
}
return null;
@ -200,7 +200,7 @@ public class TestPlayer implements Player {
return true;
} else if (groups[2].startsWith("spellOnTopOfStack=")) {
String spellOnTopOFStack = groups[2].substring(18);
if (game.getStack().size() > 0) {
if (!game.getStack().isEmpty()) {
StackObject stackObject = game.getStack().getFirst();
if (stackObject != null && stackObject.getStackAbility().toString().contains(spellOnTopOFStack)) {
return true;

View file

@ -987,7 +987,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
public enum StackClause {
WHILE_ON_STACK,
WHILE_NOT_ON_STACK;
WHILE_NOT_ON_STACK
}
/**