#vulnerable code 
                             public void testNext() {
		
		Iterator iter = new ResultSetIterator(this.rs);

		int rowCount = 0;
		Object[] row = null;
		while (iter.hasNext()) {
			rowCount++;
			row = (Object[]) iter.next();

			assertNotNull(row);
			assertEquals(COLS, row.length);
		}

		assertEquals(ROWS, rowCount);
		assertEquals("4", row[0]);
		assertEquals("5", row[1]);
		assertEquals("6", row[2]);
	} 
                            #location 16 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             public void testNext() {
		
		Iterator iter = new ResultSetIterator(this.rs);

		Object[] row = null;
		assertTrue(iter.hasNext());
		row = (Object[]) iter.next();
		assertEquals(COLS, row.length);
		assertEquals("1", row[0]);
		assertEquals("2", row[1]);
		assertEquals("3", row[2]);
		
		assertTrue(iter.hasNext());
		row = (Object[]) iter.next();
		assertEquals(COLS, row.length);

		assertEquals("4", row[0]);
		assertEquals("5", row[1]);
		assertEquals("6", row[2]);
		
		assertFalse(iter.hasNext());
	}