### Question:
TurtleSoup { public static List<Double> calculateHeadings(List<Integer> xCoords, List<Integer> yCoords) { List<Double> ans = new ArrayList<>(); int length = xCoords.size(); double temp = 0; for (int i = 1; i < length; i++) { temp = calculateHeadingToPoint(temp, xCoords.get(i - 1), yCoords.get(i - 1), xCoords.get(i), yCoords.get(i)); ans.add(temp); } return ans; }  static void drawSquare(Turtle turtle, int sideLength); static double calculateRegularPolygonAngle(int sides); static int calculatePolygonSidesFromAngle(double angle); static void drawRegularPolygon(Turtle turtle, int sides, int sideLength); static double calculateHeadingToPoint(double currentHeading, int currentX, int currentY, int targetX,
			int targetY); static List<Double> calculateHeadings(List<Integer> xCoords, List<Integer> yCoords); static void drawPersonalArt(Turtle turtle); static void main(String args[]);  }### Answer:
@Test public void calculateHeadingsTest() { List<Integer> xpoints = new ArrayList<>(); List<Integer> ypoints = new ArrayList<>(); xpoints.add(0); xpoints.add(1); xpoints.add(1); ypoints.add(0); ypoints.add(1); ypoints.add(2); List<Double> result = TurtleSoup.calculateHeadings(xpoints, ypoints); assertEquals(2, result.size()); assertEquals(45.0, result.get(0), 0.001); assertEquals(315.0, result.get(1), 0.001); }