### Question:
AsyncLearning extends Learning<OBSERVATION, ACTION, ACTION_SPACE, NN> implements IAsyncLearning { public void train() { log.info("AsyncLearning training starting."); canContinue = listeners.notifyTrainingStarted(); if (canContinue) { launchThreads(); monitorTraining(); } listeners.notifyTrainingFinished(); }  void addListener(TrainingListener listener); abstract IAsyncLearningConfiguration getConfiguration(); @Override int getStepCount(); void train(); void terminate();  }### Answer:
@Test public void when_trainStartReturnsStop_expect_noTraining() { when(mockTrainingListener.onTrainingStart()).thenReturn(TrainingListener.ListenerResponse.STOP); asyncLearning.train(); verify(mockTrainingListener, times(1)).onTrainingStart(); verify(mockTrainingListener, times(1)).onTrainingEnd(); }
@Test public void when_training_expect_onTrainingProgressCalled() { asyncLearning.setProgressMonitorFrequency(100); when(mockTrainingListener.onTrainingProgress(eq(asyncLearning))).thenReturn(TrainingListener.ListenerResponse.STOP); asyncLearning.train(); verify(mockTrainingListener, times(1)).onTrainingStart(); verify(mockTrainingListener, times(1)).onTrainingEnd(); verify(mockTrainingListener, times(1)).onTrainingProgress(eq(asyncLearning)); }