Add java 11 support for #987 (o-t) (#1051)

* Use java 11

* Use .of
- Replace Arrays.asList with List.of
- Replace HashSet<>(List.of()) with Set.of

* Formatting
This commit is contained in:
Leon Mak
2019-10-29 14:37:40 +08:00
committed by Ilkka Seppälä
parent dd971d8c19
commit c8a481bb77
37 changed files with 176 additions and 257 deletions

View File

@ -23,17 +23,7 @@
package com.iluwatar.specification.app;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import com.iluwatar.specification.creature.Creature;
import com.iluwatar.specification.creature.Dragon;
import com.iluwatar.specification.creature.Goblin;
import com.iluwatar.specification.creature.KillerBee;
import com.iluwatar.specification.creature.Octopus;
import com.iluwatar.specification.creature.Shark;
import com.iluwatar.specification.creature.Troll;
import com.iluwatar.specification.creature.*;
import com.iluwatar.specification.property.Color;
import com.iluwatar.specification.property.Movement;
import com.iluwatar.specification.selector.ColorSelector;
@ -41,6 +31,9 @@ import com.iluwatar.specification.selector.MovementSelector;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.stream.Collectors;
/**
*
* The central idea of the Specification pattern is to separate the statement of how to match a
@ -64,8 +57,7 @@ public class App {
public static void main(String[] args) {
// initialize creatures list
List<Creature> creatures =
Arrays.asList(new Goblin(), new Octopus(), new Dragon(), new Shark(), new Troll(),
new KillerBee());
List.of(new Goblin(), new Octopus(), new Dragon(), new Shark(), new Troll(), new KillerBee());
// find all walking creatures
LOGGER.info("Find all walking creatures");
List<Creature> walkingCreatures =