#vulnerable code 
                                void doTestFeedForward(Factory<Double, ?> factory) {

        int counter = 0;

        ArtificialNeuralNetwork network = this.getInitialNetwork(factory).get();

        for (Data triplet : this.getTestCases()) {
            if ((triplet.input != null) && (triplet.expected != null)) {
                TestUtils.assertEquals(triplet.expected, network.invoke(triplet.input), this.precision());
                counter++;
            }
        }

        if (counter == 0) {
            TestUtils.fail(TEST_DID_NOT_DO_ANYTHING);
        }
    } 
                            #location 9 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                void doTestFeedForward(final Factory<Double, ?> factory) {

        int counter = 0;

        ArtificialNeuralNetwork network = this.getInitialNetwork(factory);

        NetworkInvoker invoker = network.newInvoker();

        for (Data triplet : this.getTestCases()) {
            if ((triplet.input != null) && (triplet.expected != null)) {
                TestUtils.assertEquals(triplet.expected, invoker.invoke(triplet.input), this.precision());
                counter++;
            }
        }

        if (counter == 0) {
            TestUtils.fail(TEST_DID_NOT_DO_ANYTHING);
        }
    }