### Question:
SpatialDimensionFF extends FunctionBase1 { @Override public NodeValue exec(NodeValue v) { try { GeometryWrapper geometry = GeometryWrapper.extract(v); Integer dimension = geometry.getSpatialDimension(); return NodeValue.makeNodeInteger(dimension); } catch (DatatypeFormatException ex) { throw new ExprEvalException(ex.getMessage(), ex); } }  @Override NodeValue exec(NodeValue v);  }### Answer:
@Test public void testExec_2_Dimension() { NodeValue geometryLiteral = NodeValue.makeNode("<http: SpatialDimensionFF instance = new SpatialDimensionFF(); NodeValue expResult = NodeValue.makeNodeInteger(2); NodeValue result = instance.exec(geometryLiteral); assertEquals(expResult, result); }
@Test public void testExec_3_Dimension() { NodeValue geometryLiteral = NodeValue.makeNode("<http: SpatialDimensionFF instance = new SpatialDimensionFF(); NodeValue expResult = NodeValue.makeNodeInteger(3); NodeValue result = instance.exec(geometryLiteral); assertEquals(expResult, result); }
@Test public void testExec_2M_Dimension() { NodeValue geometryLiteral = NodeValue.makeNode("<http: SpatialDimensionFF instance = new SpatialDimensionFF(); NodeValue expResult = NodeValue.makeNodeInteger(2); NodeValue result = instance.exec(geometryLiteral); assertEquals(expResult, result); }
@Test public void testExec_3M_Dimension() { NodeValue geometryLiteral = NodeValue.makeNode("<http: SpatialDimensionFF instance = new SpatialDimensionFF(); NodeValue expResult = NodeValue.makeNodeInteger(3); NodeValue result = instance.exec(geometryLiteral); assertEquals(expResult, result); }