@Override
        public void addEdge(Edge edge) {

                // check to see if it is a valid edge
                if (!edge.validGameEdge()) {
                        throw new IllegalArgumentException("Invalid edge inserted.  Edges must have both of their endpoints defined.");
                }

                // Check to see that both nodes have been added to the ship
                for (Node n : edge.getAdjacent()) {
                        if (!nodeMap.containsValue(n)) {
                                throw new IllegalStateException("Both nodes must be added before an edge can be added");
                        }
                }

                // Check to see if there are no contradictions
                // For each node in the edge
                for (Node n : edge.getAdjacent()) {
                        // For each edge in each one of those nodes
                        for (Edge e : nodeMap.get(n.getCoordinates()).getAdjacent()) {
                                // If there is an edge that connects the same
                                // two nodes as the one being added
                                if (e.getAdjacent().equals(edge.getAdjacent())) {
                                        // They better match edge states or else
                                        // there is a contradiction
                                        if (!e.getEdgeState().equals(edge.getEdgeState())) {
                                                throw new IllegalStateException("There is a contradiction in the edge states");
                                        }
                                }
                        }

                }

                // Add the edge to both nodes
                for (Node n : edge.getAdjacent()) {
                        nodeMap.get(n.getCoordinates()).addEdge(edge);
                }

                // Add the edge to the edgeMap
                edgeMap.put(edge.getAdjacent(), edge);

        }