### Question:
StandardLiveActivityRunner implements LiveActivityRunner { @Override public void startup() { if (obtainInstanceLock(InstanceLockState.STARTUP)) { try { if (instance == null) { try { configuration.load(); instance = activityWrapper.newInstance(); activityLog = liveActivityRuntime.getActivityLog(installedActivity, configuration, activityFilesystem); liveActivityRuntime.initializeActivityInstance(installedActivity, activityFilesystem, instance, configuration, activityLog, activityWrapper.newExecutionContext()); instance.startup(); if (!instance.getActivityStatus().getState().isRunning()) { instance = null; } } catch (Throwable e) { setActivityStatusUnprotected(new ActivityStatus(ActivityState.STARTUP_FAILURE, null, e)); if (instance != null) { try { instance.handleStartupFailure(); } catch (Throwable e1) { liveActivityRuntime.getSpaceEnvironment().getLog() .error("Error cleaning up activity which could not start", e1); } instance = null; } } if (instance == null) { cleanupResources(); } } else { liveActivityRuntime.getSpaceEnvironment().getLog() .warn(String.format("Attempt to start activity %s that is already started", uuid)); } } finally { releaseInstanceLock(); } } } StandardLiveActivityRunner(InstalledLiveActivity installedActivity, ActivityWrapper activityWrapper,
      InternalLiveActivityFilesystem activityFilesystem, LiveActivityConfiguration configuration,
      LiveActivityRunnerListener liveActivityRunnerListener, LiveActivityRuntime liveActivityRuntime); @Override String getUuid(); @Override void updateConfiguration(Map<String, String> update); @Override void startup(); @Override void shutdown(); @Override void activate(); @Override void deactivate(); @Override ActivityStatus sampleActivityStatus(); @Override ActivityStatus getCachedActivityStatus(); @Override Activity getInstance(); @VisibleForTesting void setCachedActivityStatus(ActivityStatus cachedActivityStatus); @Override void setActivityStatus(ActivityStatus status); @Override String getDisplayName(); @Override @VisibleForTesting ActivityWrapper getActivityWrapper(); @Override void markStale(); @Override boolean isStale();  }### Answer:
@Test public void testStartupSuccess() { runner.startup(); Mockito.verify(instance).startup(); }
@Test public void testStartupFail() { Mockito.when(activityWrapper.newInstance()).thenThrow(new RuntimeException()); runner.startup(); Mockito.verify(instance, Mockito.times(0)).startup(); Mockito.verify(liveActivityRunnerListener).onNoInstanceActivityStatusEvent(runner); }