}
if (method.getReturnType() == double.class) {
return new DoubleResult((Double) method.invoke(geometry, args));
}
if (method.getReturnType() == int.class) {
return new IntegerResult((Integer) method.invoke(geometry, args));
}
}
catch (InvocationTargetException e) {
Throwable t = e.getTargetException();
if (t instanceof Exception)