/** * Executes the specified task and returnes an execution result. * @param callable * the task to be executed * @param <RESULTTYPE> * the return type of the operation * @return * the execution result monad */ public static <RESULTTYPE> ExecutionResult<RESULTTYPE> runProtected(Callable<RESULTTYPE> callable) { try { return ExecutionResult.ofSuccess(callable.call()); } catch (Exception e) { return ExecutionResult.ofException(e); } }