Code example for SortedSet

Methods: add

0
            if (!(graph.containsKey(from) && graph.containsKey(to)))
            { 
                throw new NoSuchElementException("Missing nodes from graph");
            } 
 
            graph.get(from).add(to);
        } 
 
        public void removeEdge(T from, T to)
        { 
            if (!(graph.containsKey(from) && graph.containsKey(to)))
            { 
                throw new NoSuchElementException("Missing nodes from graph");
            } 
 
            graph.get(from).remove(to);
        } 
 
        public boolean edgeExists(T from, T to)
        { 
            if (!(graph.containsKey(from) && graph.containsKey(to)))