code: public static Integer getThreadPriorityFromTaskPriority(final int taskPriority)
    {
      if (taskPriority == 0) {
        return null;
      }
      int finalPriority = taskPriority + Thread.NORM_PRIORITY;
      if (taskPriority > Thread.MAX_PRIORITY) {
        return Thread.MAX_PRIORITY;
      }
      if (finalPriority < Thread.MIN_PRIORITY) {
        return Thread.MIN_PRIORITY;
      }
      return finalPriority;
    }
docs: Return the thread-factory friendly priorities from the task priority
  
  @param taskPriority The priority for the task. >0 means high. 0 means inherit from current thread, <0 means low.
  
  @return The thread priority to use in a thread factory, or null if no priority is to be set