code: public int compare(ByteBuffer o1, ByteBuffer o2)
      {
          if (!o1.hasRemaining() || !o2.hasRemaining())
              return o1.hasRemaining() ? 1 : o2.hasRemaining() ? -1 : 0;
  
          // False is 0, True is anything else, makes False sort before True.
          byte b1 = o1.get(o1.position());
          byte b2 = o2.get(o2.position());
          if (b1 == 0)
              return b2 == 0 ? 0 : -1;
          return b2 == 0 ? 1 : 0;
      }
docs: singleton