PointND implements Serializable { @Override public String toString() { return getClass().getName() + Arrays.deepToString(coordinates); } 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 testToString() { PointND<Double> p = new PointND<>(1.0, 2.0); assertEquals("de.erichseifert.gral.util.PointND[1.0, 2.0]", p.toString()); }