code: public static boolean checkMultipleBitSet(int flags) {
      boolean set = false;
      while (flags != 0) {
        if ((flags & 0x01) != 0) {
          if (set) { return false; }
          else { set = true; }
        }
        flags = flags >> 1;
      }
      return false;
    }
docs: Utility function to check if multiple bits are set for flags
  @param flags flags to check
  @return true if multiple bits are set