public void testEdgeMethodsExceptions() throws Exception {
        Graph<String, Integer> graph = newGraph();
        try {
            graph.containsEdge("Delhi", "Mumbai");
            fail();
        } catch (IllegalArgumentException e) {

        }
        try {
            graph.removeEdge("Delhi", "Mumbai");
            fail();
        } catch (IllegalArgumentException e) {

        }
        try {
            graph.getEdge("Delhi", "Mumbai");
            fail();
        } catch (IllegalArgumentException e) {

        }
        graph.putEdge("Delhi", "Mumbai", 200);
        graph.putEdge("Delhi", "Madras", 500);
        graph.putEdge("Mumbai", "Madras", 300);
        assertEquals(3, graph.numEdges());
        edgeMethodFailure(getEdgeMethod("containsEdge"), graph, "Mumbai", "Pune");
        assertEquals(3, graph.numEdges());
        edgeMethodFailure(getEdgeMethod("getEdge"), graph, "Mumbai", "Pune");
        assertEquals(3, graph.numEdges());
        edgeMethodFailure(getEdgeMethod("removeEdge"), graph, "Mumbai", "Pune");
        assertEquals(3, graph.numEdges());

        try {
            graph.getOutgoingEdges(null);
            fail();
        } catch (NullPointerException e) {

        }

        try {
            graph.getIncomingEdges(null);
            fail();
        } catch (NullPointerException e) {

        }
        try {
            graph.getOutgoingEdges("Pune");
            fail();
        } catch (IllegalArgumentException e) {

        }
        try {
            graph.getIncomingEdges("Pune");
            fail();
        } catch (IllegalArgumentException e) {

        }
    }