code: public static void closeIfNecessary(Closeable closeable) throws ODataClientException {
          if (closeable != null) {
              try {
                  closeable.close();
              } catch (IOException e) {
                  throw new ODataClientException("Could not close '" + closeable.getClass().getSimpleName() + "'", e);
              }
          }
      }
docs: Close closable objects if it is necessary. Mostly used to close connections.
  
  @param closeable closable object
  @throws ODataClientException