Ellipsoid { public List<Vector3d> getSemiAxes() { final double[] radii = { a, b, c }; final ArrayList<Vector3d> axes = Stream.generate(Vector3d::new).limit(3) .collect(Collectors.toCollection(ArrayList::new)); for (int i = 0; i < 3; i++) { final Vector3d axis = axes.get(i); orientation.getColumn(i, axis); axis.mul(radii[i]); } return axes; } Ellipsoid(final double a, final double b, final double c);  Ellipsoid(final Vector3dc u, final Vector3dc v, final Vector3dc w); double getA(); void setA(final double a); double getB(); void setB(final double b); double getC(); void setC(final double c); Vector3d getCentroid(); void setCentroid(final Vector3dc centroid); Matrix4d getOrientation(); void setOrientation(final Matrix3dc semiAxes); List<Vector3d> getSemiAxes(); double getVolume(); @SuppressWarnings("unchecked") void initSampling(final OpEnvironment ops); List<Vector3d> samplePoints(final long n); void setSemiAxes(final Vector3dc u, final Vector3dc v,
		final Vector3dc w);  }
@Test public void testGetSemiAxes() { final double a = 2.0; final double b = 4.0; final double c = 8.0; final Matrix3dc orientation = new Matrix3d( -1, 0, 0, 0, -1, 0, 0, 0, 1 ); final List<Vector3d> expectedAxes = Arrays.asList(new Vector3d(-a, 0, 0), new Vector3d(0, -b, 0), new Vector3d(0, 0, c)); final Ellipsoid ellipsoid = new Ellipsoid(b, c, a); ellipsoid.setOrientation(orientation); final List<Vector3d> semiAxes = ellipsoid.getSemiAxes(); for (int i = 0; i < 3; i++) { assertEquals("Default semi-axis is incorrect", expectedAxes.get(i), semiAxes.get(i)); } }