SeekingAlgorithm implements SeekingMotionAlgorithm, Serializable, Cloneable { @Pure @Override public Vector2D<?, ?> calculate(Point2D<?, ?> position, double linearSpeed, double maxLinear, Point2D<?, ?> target) { final Vector2d direction = new Vector2d( target.getX() - position.getX(), target.getY() - position.getY()); direction.setLength(maxLinear); return direction; }  @Pure @Override SeekingAlgorithm clone(); @Pure @Override Vector2D<?, ?> calculate(Point2D<?, ?> position, double linearSpeed, double maxLinear, Point2D<?, ?> target);  }
@Test public void calculate() { assertFpVectorEquals(3.42997, 2.05798, this.seek.calculate(new Point2d(1, 2), 3, 4, new Point2d(6, 5))); }