S2Point implements Point<Sphere2D> { public Space getSpace() { return Sphere2D.getInstance(); } S2Point(final double theta, final double phi);  S2Point(final Vector3D vector); private  S2Point(final double theta, final double phi, final Vector3D vector); double getTheta(); double getPhi(); Vector3D getVector(); Space getSpace(); boolean isNaN(); S2Point negate(); double distance(final Point<Sphere2D> point); static double distance(S2Point p1, S2Point p2); @Override boolean equals(Object other); @Override int hashCode(); static final S2Point PLUS_I; static final S2Point PLUS_J; static final S2Point PLUS_K; static final S2Point MINUS_I; static final S2Point MINUS_J; static final S2Point MINUS_K; static final S2Point NaN; }
@Test public void testSpace() { S2Point a = new S2Point(1.0, 1.0); Assert.assertTrue(a.getSpace() instanceof Sphere2D); Assert.assertEquals(2, a.getSpace().getDimension()); Assert.assertTrue(a.getSpace().getSubSpace() instanceof Sphere1D); }