}
public void testBuildPoint() {
// test positionfactory
PositionFactory posFactory = builder.getPositionFactory();
DirectPosition position = posFactory.createDirectPosition(new double[] { 48.44, -123.37 });
// test primitivefactory
PrimitiveFactory primitiveFactory = builder.getPrimitiveFactory();
System.out.println(primitiveFactory.getCoordinateReferenceSystem());
Point point = primitiveFactory.createPoint(new double[] { 48.44, -123.37 });
assertTrue(position.equals(point.getCentroid()));
// change CRS and test
builder.setCoordianteReferenceSystem(DefaultGeographicCRS.WGS84_3D);
PrimitiveFactory primitiveFactory3D = builder.getPrimitiveFactory();
Point point3D = primitiveFactory3D.createPoint(new double[] { 48.44, -123.37, 1.0 });
assertFalse(point.getCoordinateReferenceSystem().equals(point3D.getCoordinateReferenceSystem()));
assertFalse(point.equals(point3D));
// back to 2D
builder.setCoordianteReferenceSystem(DefaultGeographicCRS.WGS84);
PositionFactory pf = builder.getPositionFactory();
PrimitiveFactoryImpl primf = (PrimitiveFactoryImpl) builder.getPrimitiveFactory();
AggregateFactory agf = builder.getAggregateFactory();
List<DirectPosition> directPositionList = new ArrayList<DirectPosition>();
directPositionList.add(pf.createDirectPosition(new double[] {20, 10}));
directPositionList.add(pf.createDirectPosition(new double[] {40, 10}));
directPositionList.add(pf.createDirectPosition(new double[] {50, 40}));
directPositionList.add(pf.createDirectPosition(new double[] {30, 50}));
directPositionList.add(pf.createDirectPosition(new double[] {10, 30}));
directPositionList.add(pf.createDirectPosition(new double[] {20, 10}));
Ring exteriorRing = primf.createRingByDirectPositions(directPositionList);
List<Ring> interiors = new ArrayList<Ring>();
SurfaceBoundary surfaceBoundary1 = primf.createSurfaceBoundary(exteriorRing, interiors );