public synchronized Object getInstanceIfFree()
  {

    // Check if the pool is empty.
    if (!freeStack.isEmpty())
    {

      // Remove object from end of free pool.
      Object result = freeStack.remove(freeStack.size() - 1);
      return result;
    }

    return null;
  }
public synchronized Object getInstanceIfFree ( ) { if ( ! freeStack . isEmpty ( ) ) { Object result = freeStack . remove ( freeStack . size ( ) - 1 ) ; return result ; } return null ; }
Get an instance of the given object in this pool if available


@return an instance of the given object if available or null