Refactor PriorityBlockingQueue examples

This commit is contained in:
pivovarit 2017-02-04 17:02:46 +01:00
parent f69deeca2d
commit 02245b75a8
1 changed files with 1 additions and 7 deletions

View File

@ -1,12 +1,10 @@
package com.baeldung.concurrent.priorityblockingqueue;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import java.util.ArrayList;
import java.util.concurrent.PriorityBlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.stream.IntStream;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.util.Lists.newArrayList;
@ -24,11 +22,7 @@ public class PriorityBlockingQueueUnitTest {
queue.add(3);
queue.add(4);
polledElements.add(queue.poll());
polledElements.add(queue.poll());
polledElements.add(queue.poll());
polledElements.add(queue.poll());
polledElements.add(queue.poll());
queue.drainTo(polledElements);
assertThat(polledElements).containsExactly(1, 2, 3, 4, 5);
}