### Question:
PointToEmbeddedValueAdapter implements Function<AbstractPoint, PointValue> { @Override public PointValue apply(AbstractPoint object) { if (object instanceof CartesianPoint2d) { CartesianPoint2d point = (CartesianPoint2d) object; return Values.pointValue(CoordinateReferenceSystem.Cartesian, point.getX(), point.getY()); } else if (object instanceof CartesianPoint3d) { CartesianPoint3d point = (CartesianPoint3d) object; return Values.pointValue(CoordinateReferenceSystem.Cartesian_3D, point.getX(), point.getY(), point.getZ()); } else if (object instanceof GeographicPoint2d) { GeographicPoint2d point = (GeographicPoint2d) object; return Values.pointValue(CoordinateReferenceSystem.WGS84, point.getLongitude(), point.getLatitude()); } else if (object instanceof GeographicPoint3d) { GeographicPoint3d point = (GeographicPoint3d) object; return Values.pointValue(CoordinateReferenceSystem.WGS84_3D, point.getLongitude(), point.getLatitude(), point.getHeight()); } else { throw new IllegalArgumentException("Unsupported point implementation: " + object.getClass()); } }  @Override PointValue apply(AbstractPoint object);  }### Answer:
@Test public void mappingShouldWork() { PointToEmbeddedValueAdapter adapter = new PointToEmbeddedValueAdapter(); Point point; point = adapter.apply(new GeographicPoint2d(10, 20)); Assertions.assertThat(point.getCRS().getCode()).isEqualTo(4326); Assertions.assertThat(point.getCoordinate().getCoordinate().get(0)).isEqualTo(20.0); Assertions.assertThat(point.getCoordinate().getCoordinate().get(1)).isEqualTo(10.0); point = adapter.apply(new CartesianPoint2d(10, 20)); Assertions.assertThat(point.getCRS().getCode()).isEqualTo(7203); Assertions.assertThat(point.getCoordinate().getCoordinate().get(0)).isEqualTo(10.0); Assertions.assertThat(point.getCoordinate().getCoordinate().get(1)).isEqualTo(20.0); point = adapter.apply(new GeographicPoint3d(10.0, 20.0, 30)); Assertions.assertThat(point.getCRS().getCode()).isEqualTo(4979); Assertions.assertThat(point.getCoordinate().getCoordinate().get(0)).isEqualTo(20.0); Assertions.assertThat(point.getCoordinate().getCoordinate().get(1)).isEqualTo(10.0); Assertions.assertThat(point.getCoordinate().getCoordinate().get(2)).isEqualTo(30.0); point = adapter.apply(new CartesianPoint3d(10.0, 20.0, 30)); Assertions.assertThat(point.getCRS().getCode()).isEqualTo(9157); Assertions.assertThat(point.getCoordinate().getCoordinate().get(0)).isEqualTo(10.0); Assertions.assertThat(point.getCoordinate().getCoordinate().get(1)).isEqualTo(20.0); Assertions.assertThat(point.getCoordinate().getCoordinate().get(2)).isEqualTo(30.0); }