public Object handle(Invocation invocation) throws Throwable {
Object result = delegate.handle(invocation);
Class<?> returnType = invocation.getMethod().getReturnType();
if(result == null && returnType.isPrimitive()) {
//primitive values cannot be null
return new HandyReturnValues().returnFor(returnType);
} else {
return result;
}
}