public void testCalculateTurnAngle() {
// Graph for a fictional grid city with turn restrictions
IntersectionVertex v1 = vertex("maple_1st", new Coordinate(2.0, 2.0), false);
IntersectionVertex v2 = vertex("maple_2nd", new Coordinate(2.0, 1.0), false);
StreetEdge e1 = edge(v1, v2, 1.0, false);
// Edge has same first and last angle.
assertEquals(90, e1.getInAngle());
assertEquals(90, e1.getOutAngle());
// 2 new ones
IntersectionVertex v3 = vertex("test2", new Coordinate(1.0, 1.0), false);
// Second edge
StreetEdge e2 = edge(v2, v3, 1.0, false);
assertEquals(0, e2.getInAngle());
assertEquals(0, e2.getOutAngle());
// Difference should be about 90.
int diff = (e1.getOutAngle() - e2.getInAngle());
assertEquals(90, diff);
int turnAngle = costModel.calculateTurnAngle(e1, e2, options);
assertEquals(270, turnAngle);
}