TorusAgent implements ILocated2D { @Override public double getY() { return y; } TorusAgent(TorusWorld world, int startX, int startY, int type); int getAgentType(); @Override Tuple2D getPosition(); @Override double distance(ILocated2D other); @Override double getX(); @Override double getY(); void move(int dx, int dy); Color getColor(); boolean isCoLocated(TorusAgent other); boolean isCoLocated(TorusAgent[] others); TorusAgent closestAgent(TorusAgent[] others); double[] distances(TorusAgent[] others); double shortestXOffset(TorusAgent torusAgent); double shortestYOffset(TorusAgent torusAgent);  }
@Test public void testGetY() { TorusAgent otherPred = new TorusAgent(new TorusWorld(100, 100), 48, 24, 0); TorusAgent otherPrey = new TorusAgent(new TorusWorld(100, 100), 79, 33, 1); assertEquals(prey.getY(), 0, doubleThreshold); assertEquals(pred.getY(), 0, doubleThreshold); assertEquals(otherPrey.getY(), 33, doubleThreshold); assertEquals(otherPred.getY(), 24, doubleThreshold); }