#vulnerable code 
                                @Test
    public void singleOrNull() {
       U<Integer> uWithMoreElement = new U<>(asList(1, 2, 3));
       U<Integer> uWithOneElement = new U<>(asList(1));

       final Integer result1 = U.singleOrNull(asList(1, 2, 3));
       assertNull(result1);
       final int result2 = U.singleOrNull(asList(1));
       assertEquals(1, result2);
       final Integer result3 = U.singleOrNull(new ArrayList<>());
       assertNull(result3);
       final Integer result4 = U.singleOrNull(asList(1, 2, 3), item -> item % 2 == 1);
       assertNull(result4);
       final int result5 = U.singleOrNull(asList(1, 2, 3), item -> item % 2 == 0);
       assertEquals(2, result5);
       final Integer result6 = U.singleOrNull(asList(1, 2, 3), item -> item  == 5);
       assertNull(result6);
       final Integer result7 = uWithMoreElement.singleOrNull();
       assertNull(result7);
       final Integer result8 = uWithOneElement.singleOrNull();
       assertEquals(result8, Integer.valueOf(1));
       final Integer result9 = uWithMoreElement.singleOrNull(item -> item % 2 == 0);
       assertEquals(result9, Integer.valueOf(2));
       final Integer result10 = uWithMoreElement.singleOrNull(item -> item % 2 == 1);
       assertNull(result10);
    } 
                            #location 8 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                @Test
    public void singleOrNull() {
       U<Integer> uWithMoreElement = new U<>(asList(1, 2, 3));
       U<Integer> uWithOneElement = new U<>(singletonList(1));

       final Integer result1 = U.singleOrNull(asList(1, 2, 3));
       assertNull(result1);
       final int result2 = U.singleOrNull(singletonList(1));
       assertEquals(1, result2);
       final Integer result3 = U.singleOrNull(new ArrayList<>());
       assertNull(result3);
       final Integer result4 = U.singleOrNull(asList(1, 2, 3), item -> item % 2 == 1);
       assertNull(result4);
       final int result5 = U.singleOrNull(asList(1, 2, 3), item -> item % 2 == 0);
       assertEquals(2, result5);
       final Integer result6 = U.singleOrNull(asList(1, 2, 3), item -> item  == 5);
       assertNull(result6);
       final Integer result7 = uWithMoreElement.singleOrNull();
       assertNull(result7);
       final Integer result8 = uWithOneElement.singleOrNull();
       assertEquals(result8, Integer.valueOf(1));
       final Integer result9 = uWithMoreElement.singleOrNull(item -> item % 2 == 0);
       assertEquals(result9, Integer.valueOf(2));
       final Integer result10 = uWithMoreElement.singleOrNull(item -> item % 2 == 1);
       assertNull(result10);
    }