mock<T> static method

  1. @visibleForTesting
void mock<T>(
  1. T instance
)

pass mocked instance to instance. And <T> the original type

Implementation

@visibleForTesting
static void mock<T>(T instance) {
  _mocks.putIfAbsent(T, () => instance);
}