### Question:
FileBackedBackendServicesRegistry extends AbstractStyxService implements Registry<BackendService>, FileChangeMonitor.Listener { @Override public CompletableFuture<ReloadResult> reload() { return this.fileBackedRegistry.reload() .thenApply(outcome -> logReloadAttempt("Admin Interface", outcome)); } @VisibleForTesting  FileBackedBackendServicesRegistry(FileBackedRegistry<BackendService> fileBackedRegistry, FileMonitor fileChangeMonitor); @VisibleForTesting  FileBackedBackendServicesRegistry(Resource originsFile, FileMonitor fileChangeMonitor); static FileBackedBackendServicesRegistry create(String originsFile); @Override Registry<BackendService> addListener(ChangeListener<BackendService> changeListener); @Override Registry<BackendService> removeListener(ChangeListener<BackendService> changeListener); @Override CompletableFuture<ReloadResult> reload(); @Override Iterable<BackendService> get(); @Override CompletableFuture<Void> stop(); @Override void fileChanged(); @Override String toString();  }### Answer:
@Test public void relaysReloadToRegistryDelegate() { FileBackedRegistry<BackendService> delegate = mock(FileBackedRegistry.class); when(delegate.reload()).thenReturn(CompletableFuture.completedFuture(ReloadResult.reloaded("relaod ok"))); registry = new FileBackedBackendServicesRegistry(delegate, FileMonitor.DISABLED); registry.reload(); verify(delegate).reload(); }
@Test public void reloadsDelegateRegistryOnStart() { FileBackedRegistry<BackendService> delegate = mock(FileBackedRegistry.class); when(delegate.reload()).thenReturn(completedFuture(reloaded("Changes applied!"))); registry = new FileBackedBackendServicesRegistry(delegate, FileMonitor.DISABLED); await(registry.start()); verify(delegate).reload(); }