PicoContainer container = container( crs ); // normal 2D
PrimitiveFactoryImpl factory = (PrimitiveFactoryImpl) container.getComponentInstanceOfType( PrimitiveFactoryImpl.class );
PositionFactory positionFactory = (PositionFactory ) container.getComponentInstanceOfType( PositionFactory.class );
DirectPosition positionA = positionFactory.createDirectPosition(new double[]{10, 10});
DirectPosition positionB = positionFactory.createDirectPosition(new double[]{70, 30});
Envelope bounds = new EnvelopeImpl( positionA, positionB );
LineSegmentImpl expected = new LineSegmentImpl( crs, new double[]{10,Double.NaN}, new double[]{70,Double.NaN}, 0.0 );
LineSegment actual = factory.processBoundsToSegment( bounds );