code: public static long safeAbs(long number) {
          // workaround for common issue where Math.abs returns a negative number for Long.MIN_VALUE
          if(Long.MIN_VALUE == number) {
              return Long.MAX_VALUE;
          } else {
              return java.lang.Math.abs(number);
          }
      }
docs: Java Math.abs has an issue with Long and Integer MIN_VALUE where it returns MIN_VALUE.
  
  @param number a number
  @return the absolute value