### Question:
MultiLayerNetworkHandler implements INetworkHandler { @Override public void performGradientsComputation(FeaturesLabels featuresLabels) { model.setInput(featuresLabels.getFeatures()); model.setLabels(featuresLabels.getLabels(labelName)); model.computeGradientAndScore(); } MultiLayerNetworkHandler(MultiLayerNetwork model, String labelName, String gradientName); @Override void notifyGradientCalculation(); @Override void notifyIterationDone(); @Override void performFit(FeaturesLabels featuresLabels); @Override void performGradientsComputation(FeaturesLabels featuresLabels); @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); @Override void fillGradientsResponse(Gradients gradients);  }### Answer:
@Test public void when_callingperformGradientsComputation_expect_modelCalledWithCorrectFeaturesLabels() { setup(false); INDArray features = Nd4j.rand(1, 2); INDArray labels = Nd4j.rand(1, 2); FeaturesLabels featuresLabels = new FeaturesLabels(features); featuresLabels.putLabels("TEST_LABEL", labels); sut.performGradientsComputation(featuresLabels); verify(modelMock, times(1)).setInput(features); ArgumentCaptor<INDArray> labelsCaptor = ArgumentCaptor.forClass(INDArray.class); verify(modelMock, times(1)).setLabels(labelsCaptor.capture()); Object debug = labelsCaptor.getAllValues(); INDArray labelsArg = labelsCaptor.getValue(); assertSame(labels, labelsArg); verify(modelMock, times(1)).computeGradientAndScore(); }