Minor refactorings and code style changes (#807)
* Made minor changes in some patterns such as removed throws clause where not needed, changed incorrect order of arguments in assertEquals * Minor refactorings and code style changes. 1) Removed several use of raw types 2) Removed unnecessary throws clauses 3) Used lambda expressions wherever applicable 4) Used apt assertion methods for readability 5) Use of try with resources wherever applicable 6) Corrected incorrect order of assertXXX arguments * Removed unused import from Promise * Addressed review comments * Addressed checkstyle issue
This commit is contained in:
@ -70,18 +70,18 @@ public class App {
|
||||
List<Creature> walkingCreatures =
|
||||
creatures.stream().filter(new MovementSelector(Movement.WALKING))
|
||||
.collect(Collectors.toList());
|
||||
walkingCreatures.stream().forEach(c -> LOGGER.info(c.toString()));
|
||||
walkingCreatures.forEach(c -> LOGGER.info(c.toString()));
|
||||
// find all dark creatures
|
||||
LOGGER.info("Find all dark creatures");
|
||||
List<Creature> darkCreatures =
|
||||
creatures.stream().filter(new ColorSelector(Color.DARK)).collect(Collectors.toList());
|
||||
darkCreatures.stream().forEach(c -> LOGGER.info(c.toString()));
|
||||
darkCreatures.forEach(c -> LOGGER.info(c.toString()));
|
||||
// find all red and flying creatures
|
||||
LOGGER.info("Find all red and flying creatures");
|
||||
List<Creature> redAndFlyingCreatures =
|
||||
creatures.stream()
|
||||
.filter(new ColorSelector(Color.RED).and(new MovementSelector(Movement.FLYING)))
|
||||
.collect(Collectors.toList());
|
||||
redAndFlyingCreatures.stream().forEach(c -> LOGGER.info(c.toString()));
|
||||
redAndFlyingCreatures.forEach(c -> LOGGER.info(c.toString()));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user