### Question:
SyncGradientsNeuralNetUpdater extends BaseSyncNeuralNetUpdater<Gradients> { @Override public void update(Gradients gradients) { current.applyGradients(gradients); syncTargetNetwork(); } SyncGradientsNeuralNetUpdater(ITrainableNeuralNet current,
                                         ITrainableNeuralNet target,
                                         NeuralNetUpdaterConfiguration configuration); @Override void update(Gradients gradients);  }### Answer:
@Test public void when_callingUpdate_expect_currentUpdatedAndtargetNotChanged() { NeuralNetUpdaterConfiguration configuration = NeuralNetUpdaterConfiguration.builder() .build(); SyncGradientsNeuralNetUpdater sut = new SyncGradientsNeuralNetUpdater(currentMock, targetMock, configuration); Gradients gradients = new Gradients(10); sut.update(gradients); verify(currentMock, times(1)).applyGradients(gradients); verify(targetMock, never()).applyGradients(any()); }
@Test public void when_callingUpdate_expect_targetUpdatedFromCurrentAtFrequency() { NeuralNetUpdaterConfiguration configuration = NeuralNetUpdaterConfiguration.builder() .targetUpdateFrequency(3) .build(); SyncGradientsNeuralNetUpdater sut = new SyncGradientsNeuralNetUpdater(currentMock, targetMock, configuration); Gradients gradients = new Gradients(10); sut.update(gradients); sut.update(gradients); sut.update(gradients); verify(currentMock, never()).copyFrom(any()); verify(targetMock, times(1)).copyFrom(currentMock); }