code: private static final int intcmp(Integer i1, Integer i2) {
          if (i1 == null && i2 == null) {
              return 0;
          }
          if (i1 == null) {
              return -i2;
          }
          if (i2 == null) {
              return i1;
          }
          return i1 - i2;
      }
docs: mimic the behaviour of i1 - i2 in JS