code: public static <I, O> ListenableFuture<O> transformAsync(
        final ListenableFuture<I> inFuture,
        final Function<I, ListenableFuture<O>> transform
    )
    {
      final SettableFuture<O> finalFuture = SettableFuture.create();
      Futures.addCallback(inFuture, new FutureCallback<I>()
      {
        @Override
        public void onSuccess(@Nullable I result)
        {
          final ListenableFuture<O> transformFuture = transform.apply(result);
          Futures.addCallback(transformFuture, new FutureCallback<O>()
          {
            @Override
            public void onSuccess(@Nullable O result)
            {
              finalFuture.set(result);
            }
  
            @Override
            public void onFailure(Throwable t)
            {
              finalFuture.setException(t);
            }
          });
        }
  
        @Override
        public void onFailure(Throwable t)
        {
          finalFuture.setException(t);
        }
      });
      return finalFuture;
    }
docs: Guava 19 changes the Futures.transform signature so that the async form is different. This is here as a
  compatability layer until such a time as druid only supports Guava 19 or later, in which case
  Futures.transformAsync should be used
  
  This is NOT copied from guava.