code: protected Object[] getBatch() {
  
          Object[] objectArray = new Object[batchSize];
          objectArray[0] = get(); // always attempt to get at least 1, get() could
                                  // return null
                                  // if no factory was defined when instantiated.
  
          int numElements = getCurrentNumElements();
  
          for (int i = 1; i <= numElements && i < batchSize; i++) {
              objectArray[i] = get();
          }
  
          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 objects (it will always leave
  at
  least 1/2 the minimum pool size) and the batch size configured for the
  pool.
  
  @return Object[] The arrray of objects removed from the pool.