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,7 +23,7 @@
package com.iluwatar.layers;
import java.util.Arrays;
import java.util.List;
/**
*
@@ -99,16 +99,18 @@ public class App {
cakeBakingService.saveNewTopping(new CakeToppingInfo("cherry", 350));
CakeInfo cake1 =
new CakeInfo(new CakeToppingInfo("candies", 0), Arrays.asList(new CakeLayerInfo(
"chocolate", 0), new CakeLayerInfo("banana", 0), new CakeLayerInfo("strawberry", 0)));
new CakeInfo(new CakeToppingInfo("candies", 0), List.of(
new CakeLayerInfo("chocolate", 0),
new CakeLayerInfo("banana", 0),
new CakeLayerInfo("strawberry", 0)));
try {
cakeBakingService.bakeNewCake(cake1);
} catch (CakeBakingException e) {
e.printStackTrace();
}
CakeInfo cake2 =
new CakeInfo(new CakeToppingInfo("cherry", 0), Arrays.asList(
new CakeLayerInfo("vanilla", 0), new CakeLayerInfo("lemon", 0), new CakeLayerInfo(
new CakeInfo(new CakeToppingInfo("cherry", 0), List.of(
new CakeLayerInfo("vanilla", 0), new CakeLayerInfo("lemon", 0), new CakeLayerInfo(
"strawberry", 0)));
try {
cakeBakingService.bakeNewCake(cake2);