MapGraph implements Graph, Serializable { public MapGraph(GPS upperLeft, GPS lowerRight) throws EmptyInputException, InvalidInputException, InvalidGPSCoordinateException { GPSRectangle MapRect = new GPSRectangle(upperLeft,lowerRight); this.MapRectangle = MapRect; nodes=new HashMap<Integer,MapNode>(); } MapGraph(GPS upperLeft, GPS lowerRight);  MapGraph(GPSRectangle MapRectangle);  MapGraph(float top, float right, float bottom, float left); String getFilename(); void setFilename(String filename); int getSize(); Iterator<MapNode> getNodeIt(); Iterator<MapEdge> getEdgeIt(); void insertNode(int uid, GPSCoordinate gps); void insertNodeWithoutGPS(int uid); void insertOneWay(int startNodeUID, int endNodeUID, int wayID, int length, StreetType streetType, String name); void insertEdgeBothDirections(int startNodeUID, int endNodeUID, int wayID, int length, StreetType streetType, String name); void insertEdge(int startNodeUID, int endNodeUID, int wayID, int length, StreetType streetType); void insertEdge(int startNodeUID, int endNodeUID, int wayID, int length, StreetType streetType, String name); MapNode getClosestNode(GPSCoordinate gps); void deleteIsolatedNodes(); HierarchyMapGraph exportToHierachyGraph(HierarchyMapGraph hGraph); MapNode getNode(int uid); GPSRectangle getRect(); GPS getUpperLeft(); GPS getLowerRight(); void correctLength(); String toString();  }
@Test public void testMapGraph() { try { testGraph = new MapGraph(graphKoord[0],graphKoord[1]); } catch (Exception e) { fail("Fehler bei Graph anlegen "+e.getLocalizedMessage()); } boolean fehler = false; try { @SuppressWarnings("unused") MapGraph graphFailTest = new MapGraph(graphKoord[1],graphKoord[0]); } catch (Exception e) { fehler = true; } if (fehler == false) { fail("Konstruktor hat bei Failtest 1 keine Ausnahme geworfen"); } fehler = false; try { @SuppressWarnings("unused") MapGraph graphFailTest = new MapGraph(null,null); } catch (Exception e) { fehler = true; } if (fehler == false) { fail("Konstruktor hat bei Failtest 2 keine Ausnahme geworfen"); } try { failGraph = new MapGraph(graphKoord[2],graphKoord[3]); } catch (Exception e) { fail("fehler bei failgraph am Ende "+e.getLocalizedMessage()); } this.testInsertNode(); this.testInsertEdgeIntIntIntFloatStreetType(); this.testGetNode(); this.testDeleteIsolatedNodes(); }