code: private T prepareToTake(T object) {
          try {
              if (object == null) {
                  createdTotal.incrementAndGet();
                  object = requireNonNull(poolObjectFactory.create());
              }
              else {
                  boolean ready = false;
                  try {
                      ready = poolObjectFactory.readyToTake(object);
                  } finally {
                      if (!ready) {
                          poolObjectFactory.destroy(object);
                      }
                  }
                  if (!ready) {
                      object = requireNonNull(poolObjectFactory.create());
                  }
              }
  
              return object;
          } catch (RuntimeException | Error e) {
              recoverInnerState();
              throw e;
          }
      }
docs: Verifies whether the given object is valid and whether it can be given to the calling application.
  If the object is {@code null}, a new object will be created and returned. If the object
  is not {@code null}, it will be validated and if the validation fails, a new object will be created
  and returned; otherwise a reference to the object itself will be returned. This method <b>never</b>
  returns {@code null}.
  
  @param object the object to be validated
  @return see above