Returns an Observable that epeats emitting {@code t} without completing.
Supports backpressure.

@param t
value to repeat
@param <T>
type of t

@return an observable that repeats t forever (or until unsubscribed)
965230
public static <T> Observable<T> repeating(final T t) {
        return Observable.unsafeCreate(new OnSubscribeRepeating<T>(t));
    }
717465
public static <T extends Query<?, R>, R extends Object> T createMock(Class<T> type) {
    return Mockito.mock(type, createAnswer(type));
  }
431794
public static <T> ObservableTransformer<T,T> doOnCompleteFx(Action onCompleted) {
        return obs -> obs.doOnComplete(() -> runOnFx(onCompleted));
    }
267882
public RxLoader1<A, T> start(A arg1) {
        start(observableFunc.call(arg1));
        return this;
    }
820186
public static <T> Single<T> toSingle(ListenableFuture<T> listenableFuture) {
        return RxJava2FutureUtils.createSingle(SpringFutureUtils.createValueSource(listenableFuture));
    }
1026823
@SuppressWarnings("unchecked")
    public static <T> ConnectableObservable<T> createFrom(ObservableSource<? extends T> source) {
        ObservableSource<T> sourceCast = (ObservableSource<T>) source;
        return create(sourceCast, DEFAULT_UNBOUNDED_FACTORY);
    }
1154357
function observableToPromise(observable) {
  if (!isObservable(observable)) {
    return observable;
  }
  return new Promise((resolve, reject) => {
    const subscription = observable.subscribe(
      v => {
        resolve(v);
        subscription.unsubscribe();
      },
      reject,
      () => {
        reject(new Error('no value resolved'));
      },
    );
  });
}
74290
public static <T> Observable<T> toObservable(final FutureProvider<T> provider) {
    return Observable.create(new FutureProviderToStreamHandler<>(provider));
  }
536591
public <T> T getCurrentInstance(Class<T> type) {
		return getCurrentInstance(Key.get(type));
	}
1077565
public static <T> TypeToken<T> of(Type type) {
    Assert.notNull(type, "type");
    return new TypeToken<T>(type);
  }
92317
public static <T> CompletableFuture<T> exceptionalFutureAsync(Throwable t, Executor executor) {
    CompletableFuture<T> future = new CompletableFuture<>();
    executor.execute(() -> {
      future.completeExceptionally(t);
    });
    return future;
  }
667098
private <U> ObservableFactory<T, U> propertyFactoryT(Observable<U> source, String propertyName,
		Class<U> propertyType)
	{
		return propertyFactory(source, propertyName, propertyType);
	}
1238197
public static <T> FlowableTransformer<T,T> doOnSubscribeFx(Consumer<Subscription> subscribe) {
        return obs -> obs.doOnSubscribe((d -> runOnFx(d,subscribe)));
    }
359585
static <T> Observable<T> wrap(
            ObservableSource<T> source, Collection<ReactiveInstrumenter> instrumentations) {
        if (source instanceof Callable) {
            return new RxInstrumentedCallableObservable<>(source, instrumentations);
        }
        return new RxInstrumentedObservable<>(source, instrumentations);
    }
147066
public static <T,K,V> Observable.Transformer<T,ImmutableMap<K,V>> toImmutableMap(final Func1<T,K> keyMapper, final Func1<T,V> valueMapper) {
        return new Observable.Transformer<T,ImmutableMap<K,V>>() {
            @Override
            public Observable<ImmutableMap<K, V>> call(Observable<T> observable) {
                return observable.collect(new Func0<ImmutableMap.Builder<K, V>>() {
                    @Override
                    public ImmutableMap.Builder<K, V> call() {
                        return ImmutableMap.builder();
                    }
                }, new Action2<ImmutableMap.Builder<K, V>, T>() {
                    @Override
                    public void call(ImmutableMap.Builder<K, V> builder, T t) {
                        builder.put(keyMapper.call(t), valueMapper.call(t));
                    }
                })
                .map(new Func1<ImmutableMap.Builder<K, V>, ImmutableMap<K, V>>() {
                    @Override
                    public ImmutableMap<K, V> call(ImmutableMap.Builder<K, V> builder) {
                        return builder.build();
                    }
                });
            }
        };
    }
630364
private static <T> Observable<Boolean> commitOrRollbackOnNext(final boolean isCommit,
            final Database db, Observable<T> source) {
        return source.concatMap(new Func1<T, Observable<Boolean>>() {
            @Override
            public Observable<Boolean> call(T t) {
                if (isCommit)
                    return db.commit();
                else
                    return db.rollback();
            }
        });
    }
1310912
public static <T, U extends T> CompletableFuture<T> toJava(Future<U> scalaFuture) {
		final CompletableFuture<T> result = new CompletableFuture<>();

		scalaFuture.onComplete(new OnComplete<U>() {
			@Override
			public void onComplete(Throwable failure, U success) {
				if (failure != null) {
					result.completeExceptionally(failure);
				} else {
					result.complete(success);
				}
			}
		}, Executors.directExecutionContext());

		return result;
	}