I've tried to create mock data to pass to Multiple Classes for testing, However, the creation of the Mock data doesn't work.
Essentially, HashMap<String, LinkedList<Point>>
The Point stores the data correctly,
The LinkedList stores the Points correctly,
But the HashMap no longer stores the 'x' values from the data
Here is the code: (The Rectangle is just used for other purposes)
Rectangle rect = new Rectangle(20, 20, 300, 300); HashMap<String, LinkedList<Point>> randomResultsSet = new HashMap<>(10); for (int i = 0; i < 5; i++) { LinkedList<Point> dataPoints = new LinkedList<>(); String key = "Criteria: " + i; for (int j = 0; j < 10; j++) { Point px = new Point(j, j); System.out.println("Point[" + px.x + "," + px.y + "] = " + px.toString()); dataPoints.add(px); } randomResultsSet.put(key, dataPoints); } HGraph graph1 = new HGraph(rect, randomResultsSet); System.out.println("Map: " + randomResultsSet.toString()); this.TESTINGAREA.add(graph1);
Part of the output looks like this,
Point[7,7] = java.awt.Point[x=7,y=7] Point[8,8] = java.awt.Point[x=8,y=8] Point[9,9] = java.awt.Point[x=9,y=9] DataPoints: [java.awt.Point[x=0,y=0], java.awt.Point[x=1,y=1], java.awt.Point[x=2,y=2], java.awt.Point[x=3,y=3], java.awt.Point[x=4,y=4], java.awt.Point[x=5,y=5], java.awt.Point[x=6,y=6], java.awt.Point[x=7,y=7], java.awt.Point[x=8,y=8], java.awt.Point[x=9,y=9]] Map: {Criteria: 0=[java.awt.Point[x=0,y=0], java.awt.Point[x=0,y=1], java.awt.Point[x=0,y=2], java.awt.Point[x=0,y=3], java.awt.Point[x=0,y=4], java.awt.Point[x=0,y=5], java.awt.Point[x=0,y=6], java.awt.Point[x=0,y=7], java.awt.Point[x=0,y=8], java.awt.Point[x=0,y=9]], Criteria: 2=[java.awt.Point[x=0,y=0]... BUILD SUCCESSFUL (total time: 16 seconds)