#vulnerable code 
                             @SuppressWarnings("all")
	public <T extends Edge> T getEdgeToward(String id) {
		ArrayList<? extends Edge> edges = mygraph.connectivity.get(this);

		for (Edge edge : edges) {
			if (edge.getOpposite(this).getId().equals(id))
				return (T) edge;
		}

		return null;
	} 
                            #location 5 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             @SuppressWarnings("all")
	public <T extends Edge> T getEdgeToward(String id) {
        List<? extends Edge> edges = mygraph.connectivity.get(this);

		for (Edge edge : edges) {
			if (edge.getOpposite(this).getId().equals(id))
				return (T) edge;
		}

		return null;
	}