### Question:
BlockingQueuePool implements ObjectPool<T> { @Override public T borrowObject() { final T existing = queue.poll(); if (existing != null) { return existing; } return creationFunction.get(); } BlockingQueuePool(final int maxSize, final Supplier<T> creationFunction, final Predicate<T> reuseCheck, final Consumer<T> returnPreparation); @Override T borrowObject(); @Override void returnObject(final T somethingBorrowed);  }### Answer:
@Test public void testCreateOnExhaustion() { final BlockingQueuePool<AtomicBoolean> pool = new BlockingQueuePool<>(10, AtomicBoolean::new, AtomicBoolean::get, DO_NOTHING); final AtomicBoolean firstObject = pool.borrowObject(); final AtomicBoolean secondObject = pool.borrowObject(); assertNotSame(firstObject, secondObject); }
@Test public void testCreateMoreThanMaxCapacity() { final BlockingQueuePool<AtomicBoolean> pool = new BlockingQueuePool<>(10, AtomicBoolean::new, AtomicBoolean::get, DO_NOTHING); for (int i = 0; i < 50; i++) { final AtomicBoolean value = pool.borrowObject(); assertNotNull(value); } }