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

@ -25,15 +25,10 @@ package com.iluwatar.object.pool;
import org.junit.jupiter.api.Test;
import java.util.Arrays;
import java.util.List;
import static java.time.Duration.ofMillis;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotSame;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertTimeout;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.*;
/**
* Date: 12/27/15 - 1:05 AM
@ -115,7 +110,7 @@ public class OliphauntPoolTest {
// The order of the returned instances is not determined, so just put them in a list
// and verify if both expected instances are in there.
final List<Oliphaunt> oliphaunts = Arrays.asList(pool.checkOut(), pool.checkOut());
final List<Oliphaunt> oliphaunts = List.of(pool.checkOut(), pool.checkOut());
assertEquals(pool.toString(), "Pool available=0 inUse=2");
assertTrue(oliphaunts.contains(firstOliphaunt));
assertTrue(oliphaunts.contains(secondOliphaunt));