Returns a provider which always provides instance. This should not be necessary to use in your application, but is helpful for several types of unit tests. @param instance the instance that should always be provided. This is also permitted to be null, to enable aggressive testing, altho
(final T instance)
| 50 | * return null. |
| 51 | */ |
| 52 | public static <T> Provider<T> of(final T instance) { |
| 53 | return new ConstantProvider<T>(instance); |
| 54 | } |
| 55 | |
| 56 | private static final class ConstantProvider<T> implements Provider<T> { |
| 57 | private final T instance; |
no outgoing calls