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

@ -32,7 +32,6 @@ import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import org.slf4j.LoggerFactory;
import java.util.Arrays;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
@ -50,19 +49,19 @@ public class DragonSlayingStrategyTest {
* @return The test parameters for each cycle
*/
static Collection<Object[]> dataProvider() {
return Arrays.asList(
new Object[]{
new MeleeStrategy(),
"With your Excalibur you sever the dragon's head!"
},
new Object[]{
new ProjectileStrategy(),
"You shoot the dragon with the magical crossbow and it falls dead on the ground!"
},
new Object[]{
new SpellStrategy(),
"You cast the spell of disintegration and the dragon vaporizes in a pile of dust!"
}
return List.of(
new Object[]{
new MeleeStrategy(),
"With your Excalibur you sever the dragon's head!"
},
new Object[]{
new ProjectileStrategy(),
"You shoot the dragon with the magical crossbow and it falls dead on the ground!"
},
new Object[]{
new SpellStrategy(),
"You cast the spell of disintegration and the dragon vaporizes in a pile of dust!"
}
);
}