PointND implements Serializable { public int getDimensions() { return coordinates.length; } PointND(T... coordinates); int getDimensions(); T get(int dimension); void set(int dimension, T coordinate); void setLocation(T... coordinates); Point2D getPoint2D(int dimX, int dimY); Point2D getPoint2D(); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); static final int X; static final int Y; static final int Z; }
@Test public void testCreate() { PointND<Double> p; p = new PointND<>(1.0, 2.0, 3.0, 4.0); assertEquals(4, p.getDimensions()); }