code: @SuppressWarnings("unchecked")
      public static <U extends Indexable> Observable<U> rootResource(Observable<Indexable> stream) {
          return stream.last().map(new Func1<Indexable, U>() {
              @Override
              public U call(Indexable indexable) {
                  return (U) indexable;
              }
          });
      }
docs: Gets an observable of {@link U} that emits only the root resource from a given
  observable of {@link Indexable}.
  
  @param stream the input observable of {@link Indexable}
  @param <U> the specialized type of last item in the input stream
  @return an observable that emits last item