### Question:
BackPropagation extends LMS { protected void calculateErrorAndUpdateOutputNeurons(double[] outputError) { int i = 0; final List<Neuron> outputNeurons = neuralNetwork.getOutputNeurons(); for (Neuron neuron : outputNeurons) { if (outputError[i] == 0) { neuron.setDelta(0); i++; continue; } final TransferFunction transferFunction = neuron.getTransferFunction(); final double neuronInput = neuron.getNetInput(); final double delta = outputError[i] * transferFunction.getDerivative(neuronInput); neuron.setDelta(delta); calculateWeightChanges(neuron); i++; } } BackPropagation();   }### Answer:
@Test public void testCalculateErrorAndUpdateOutputNeurons() { NeuralNetwork<BackPropagation> nn = new NeuralNetwork<>(); nn.setInputNeurons(new ArrayList<Neuron>() { { add(new Neuron()); add(new Neuron()); } }); nn.setOutputNeurons(new ArrayList<Neuron>() { { add(new Neuron()); } }); nn.setLearningRule(instance); nn.getOutputNeurons().get(0).setDelta(1); instance.calculateErrorAndUpdateOutputNeurons(new double[]{0}); assertTrue(nn.getOutputNeurons().get(0).getDelta() == 0); instance.calculateErrorAndUpdateOutputNeurons(new double[]{0.5}); assertTrue(nn.getOutputNeurons().get(0).getDelta() == 0.5); }