code: protected Object[] getBatch() {
  
          Object[] objectArray = new Object[batchSize];
          int index = 1;
          synchronized (this) {
              objectArray[0] = get(); // always get at least 1
              while (getCurrentNumElements() > minPoolSize / 2 && index < batchSize) {
                  objectArray[index] = get();
                  index++;
              }
          }
          return objectArray;
      }
docs: Gets an array of Objects from the pool. This method will return a varying
  number of elements
  based on the number of available (it will always leave at least 1/2 the
  minimum pool size) and
  the batch size configured for the pool.
  
  @return Object[] The array of objects removed from the pool