### Question:
ComputationGraphHandler implements INetworkHandler { @Override public void notifyIterationDone() { BaseNetwork.ModelCounters modelCounters = getModelCounters(); Iterable<TrainingListener> listeners = model.getListeners(); if (listeners != null) { for (TrainingListener l : listeners) { l.iterationDone(model, modelCounters.getIterationCount(), modelCounters.getEpochCount()); } } } ComputationGraphHandler(ComputationGraph model, String[] labelNames, String gradientName); @Override void notifyGradientCalculation(); @Override void notifyIterationDone(); @Override void performFit(FeaturesLabels featuresLabels); @Override void performGradientsComputation(FeaturesLabels featuresLabels); @Override void fillGradientsResponse(Gradients gradients); @Override void applyGradient(Gradients gradients, long batchSize); @Override INDArray[] recurrentStepOutput(Observation observation); @Override INDArray[] batchOutput(INDArray batch); @Override void resetState(); @Override INetworkHandler clone(); @Override void copyFrom(INetworkHandler from);  }### Answer:
@Test public void when_callingNotifyIterationDone_expect_listenersNotified() { setup(false); final Collection<TrainingListener> listeners = new ArrayList<TrainingListener>() {{ add(trainingListenerMock); }}; when(modelMock.getListeners()).thenReturn(listeners); sut.notifyIterationDone(); verify(trainingListenerMock, times(1)).iterationDone(modelMock, 123, 234); }