@Test public void shouldReturnCachedForkWhenPreviouslyLoaded() { when(validatorApiChannel.getForkInfo()).thenReturn(completedFuture(Optional.of(fork))); assertThat(forkProvider.getForkInfo()).isCompletedWithValue(fork); verify(validatorApiChannel).getForkInfo(); assertThat(forkProvider.getForkInfo()).isCompletedWithValue(fork); verifyNoMoreInteractions(validatorApiChannel); }
public SafeFuture<ForkInfo> getForkInfo() { return currentFork.map(SafeFuture::completedFuture).orElseGet(this::loadForkInfo); }
ForkProvider { public SafeFuture<ForkInfo> getForkInfo() { return currentFork.map(SafeFuture::completedFuture).orElseGet(this::loadForkInfo); } }
ForkProvider { public SafeFuture<ForkInfo> getForkInfo() { return currentFork.map(SafeFuture::completedFuture).orElseGet(this::loadForkInfo); } ForkProvider(
      final AsyncRunner asyncRunner, final ValidatorApiChannel validatorApiChannel); }
ForkProvider { public SafeFuture<ForkInfo> getForkInfo() { return currentFork.map(SafeFuture::completedFuture).orElseGet(this::loadForkInfo); } ForkProvider(
      final AsyncRunner asyncRunner, final ValidatorApiChannel validatorApiChannel); SafeFuture<ForkInfo> getForkInfo(); SafeFuture<ForkInfo> loadForkInfo(); SafeFuture<ForkInfo> requestForkInfo(); @Override String toString(); }
ForkProvider { public SafeFuture<ForkInfo> getForkInfo() { return currentFork.map(SafeFuture::completedFuture).orElseGet(this::loadForkInfo); } ForkProvider(
      final AsyncRunner asyncRunner, final ValidatorApiChannel validatorApiChannel); SafeFuture<ForkInfo> getForkInfo(); SafeFuture<ForkInfo> loadForkInfo(); SafeFuture<ForkInfo> requestForkInfo(); @Override String toString();  }