### Question:
PersistentSnapshotDownloader implements Runnable { boolean hasCompleted() { return state == State.COMPLETED; } PersistentSnapshotDownloader( CatchupAddressProvider addressProvider, CommandApplicationProcess applicationProcess,
            CoreStateDownloader downloader, Log log, TimeoutStrategy.Timeout pauseStrategy,
            Supplier<DatabaseHealth> dbHealth, Monitors monitors ); @Override void run();  }### Answer:
@Test public void shouldResumeCommandApplicationProcessIfInterrupted() throws Exception { CoreStateDownloader coreStateDownloader = mock( CoreStateDownloader.class ); when( coreStateDownloader.downloadSnapshot( any() ) ).thenReturn( false ); final CommandApplicationProcess applicationProcess = mock( CommandApplicationProcess.class ); final Log log = mock( Log.class ); NoTimeout timeout = new NoTimeout(); PersistentSnapshotDownloader persistentSnapshotDownloader = new PersistentSnapshotDownloader( catchupAddressProvider, applicationProcess, coreStateDownloader, log, timeout, () -> dbHealth, new Monitors() ); Thread thread = new Thread( persistentSnapshotDownloader ); thread.start(); awaitOneIteration( timeout ); thread.interrupt(); thread.join(); verify( applicationProcess, times( 1 ) ).pauseApplier( OPERATION_NAME ); verify( applicationProcess, times( 1 ) ).resumeApplier( OPERATION_NAME ); assertTrue( persistentSnapshotDownloader.hasCompleted() ); }