S1Point implements Point<Sphere1D> { public Space getSpace() { return Sphere1D.getInstance(); } S1Point(final double alpha); private  S1Point(final double alpha, final Vector2D vector); double getAlpha(); Vector2D getVector(); Space getSpace(); boolean isNaN(); double distance(final Point<Sphere1D> point); static double distance(S1Point p1, S1Point p2); @Override boolean equals(Object other); @Override int hashCode(); static final S1Point NaN; }
@Test public void testSpace() { S1Point a = new S1Point(1.0); Assert.assertTrue(a.getSpace() instanceof Sphere1D); Assert.assertEquals(1, a.getSpace().getDimension()); try { a.getSpace().getSubSpace(); Assert.fail("an exception should have been thrown"); } catch (MathUnsupportedOperationException muoe) { } }