code: @FFDCIgnore(Throwable.class)
      @Sensitive
      private byte[] serializeResult(Object result, ClassLoader loader) throws IOException {
          try {
              return persistentExecutor.serialize(result);
          } catch (Throwable x) {
              return persistentExecutor.serialize(new TaskFailure(x, loader, persistentExecutor, TaskFailure.NONSER_RESULT, result.getClass().getName()));
          }
      }
docs: Utility method that serializes a task result, or the failure that occurred when attempting
  to serialize the task result.
  
  @param result non-null task result
  @param loader class loader that can deserialize the task and result.
  @return serialized bytes