assertNull J Unit, fails with null pointer (JAVA) : For my project one of the returns has to be null. When testing using assertNull(Null Object here) it fails with a null pointer exception.

Can someone please tell my why?? I thought assertNull is suppose to test for null.

Heres part of my code.

    

    public static UVI calculateUVI(double[] radiation)
    {
    double calculation = 0.0;
    double[] copyRad = new double[radiation.length];
    for (int i = 0; i < radiation.length; i++)
    {
      copyRad[i] = radiation[i];
      if (radiation[i] > RADIATION_MAXIMUM)
        copyRad[i] = RADIATION_MAXIMUM;
      if (radiation[i] < RADIATION_MINIMUM)
        copyRad[i] = 0.0;

      calculation += (copyRad[i] * MD_WEIGHTS[i]);
    }

    if (radiation.length != MD_WEIGHTS.length || radiation == null)
    {
      UVI nulled = null;
      return nulled;
    }

    calculation /= B;
    UVI result = new UVI(calculation, true);
    return result;
  }


My test case is:

    

    double[] test1 = {4., 26., 30., 17., 2.};
    double[] test2 = {0., 0., 0., 0., 0.};
    double[] test3 = {4., 26., 30., 100., 2.};
    double[] test4 = {4., 26., 30., 200., 2.};
    double[] test5 = {3.4, 0., 17., 17., 2.};
    double[] test6 = {3.4, -10., 17., 17., 2.};
    double[] test7 = {1.0};
    double[] test8 = {};
    double[] test9 = null;

    UVI testOne = UVICalculator.calculateUVI(test1);
    UVI testTwo = UVICalculator.calculateUVI(test2);
    UVI testThree = UVICalculator.calculateUVI(test3);
    UVI testFour = UVICalculator.calculateUVI(test4);
    UVI testFive = UVICalculator.calculateUVI(test5);
    UVI testSix = UVICalculator.calculateUVI(test6);
    UVI testSeven = UVICalculator.calculateUVI(test7);
    UVI testEight = UVICalculator.calculateUVI(test8);
    UVI testNine= UVICalculator.calculateUVI(test9);

    assertTrue(8.8956 == testOne.getValue());
    assertTrue(0 == testTwo.getValue());
    assertTrue(8.9952 == testThree.getValue());
    assertTrue(8.9952 == testFour.getValue());
    assertTrue(4.027200000000001 == testFive.getValue());
    assertTrue(4.027200000000001 == testSix.getValue());
    assertNull(testSeven);
    assertNull(testEight);
    assertNull(testNine);
    
