code: private final boolean calculateNextBMPElement(Element element)
      {
          int currentValue    = m_nextValue_;
          m_currentCodepoint_ = m_nextCodepoint_;
          m_nextCodepoint_ ++;
          m_nextBlockIndex_ ++;
          if (!checkBlockDetail(currentValue)) {
              setResult(element, m_currentCodepoint_, m_nextCodepoint_,
                        currentValue);
              return true;
          }
          // synwee check that next block index == 0 here
          // enumerate BMP - the main loop enumerates data blocks
          while (m_nextCodepoint_ < UCharacter.SUPPLEMENTARY_MIN_VALUE) {
              // because of the way the character is split to form the index
              // the lead surrogate and trail surrogate can not be in the
              // mid of a block
              if (m_nextCodepoint_ == LEAD_SURROGATE_MIN_VALUE_) {
                  // skip lead surrogate code units,
                  // go to lead surrogate codepoints
                  m_nextIndex_ = BMP_INDEX_LENGTH_;
              }
              else if (m_nextCodepoint_ == TRAIL_SURROGATE_MIN_VALUE_) {
                  // go back to regular BMP code points
                  m_nextIndex_ = m_nextCodepoint_ >> Trie.INDEX_STAGE_1_SHIFT_;
              } else {
                  m_nextIndex_ ++;
              }
  
              m_nextBlockIndex_ = 0;
              if (!checkBlock(currentValue)) {
                  setResult(element, m_currentCodepoint_, m_nextCodepoint_,
                            currentValue);
                  return true;
              }
          }
          m_nextCodepoint_ --;   // step one back since this value has not been
          m_nextBlockIndex_ --;  // retrieved yet.
          return false;
      }
docs: Finding the next element.
  This method is called just before returning the result of
  next().
  We always store the next element before it is requested.
  In the case that we have to continue calculations into the
  supplementary planes, a false will be returned.
  @param element return result object
  @return true if the next range is found, false if we have to proceed to
  the supplementary range.