types[i] = override;
types[j] = override;
  private void resolveNeutralTypes()  {    // This implements rules N1 and N2.    final int runCount = getRunCount();        int previousLevel = baseEmbedding;    for (int run = 0; run < runCount; ++run)      {        int start = getRunStart(run);        int end = getRunLimit(run);        int level = getRunLevel(run);        byte embeddingDirection          = (((level % 2) == 0) ? Character.DIRECTIONALITY_LEFT_TO_RIGHT                                : Character.DIRECTIONALITY_RIGHT_TO_LEFT);        // These are the names used in the Bidi algorithm.        byte sor = (((Math.max(previousLevel, level) % 2) == 0)                      ? Character.DIRECTIONALITY_LEFT_TO_RIGHT                      : Character.DIRECTIONALITY_RIGHT_TO_LEFT);        int nextLevel;        if (run == runCount - 1)          nextLevel = baseEmbedding;        else          nextLevel = getRunLevel(run + 1);        byte eor = (((Math.max(level, nextLevel) % 2) == 0)                      ? Character.DIRECTIONALITY_LEFT_TO_RIGHT                      : Character.DIRECTIONALITY_RIGHT_TO_LEFT);        byte prevStrong = sor;        int neutralStart = -1;        for (int i = start; i <= end; ++i)          {            byte newStrong = -1;            byte thisType = i == end ? eor : types[i];            switch (thisType)              {              case Character.DIRECTIONALITY_LEFT_TO_RIGHT:                newStrong = Character.DIRECTIONALITY_LEFT_TO_RIGHT;                break;              case Character.DIRECTIONALITY_RIGHT_TO_LEFT:              case Character.DIRECTIONALITY_ARABIC_NUMBER:              case Character.DIRECTIONALITY_EUROPEAN_NUMBER:                newStrong = Character.DIRECTIONALITY_RIGHT_TO_LEFT;                break;              case Character.DIRECTIONALITY_BOUNDARY_NEUTRAL:              case Character.DIRECTIONALITY_OTHER_NEUTRALS:              case Character.DIRECTIONALITY_SEGMENT_SEPARATOR:              case Character.DIRECTIONALITY_PARAGRAPH_SEPARATOR:                if (neutralStart == -1)                  neutralStart = i;                break;              }            // If we see a strong character, update all the neutrals.            if (newStrong != -1)              {                if (neutralStart != -1)                  {                    byte override = (prevStrong == newStrong                                     ? prevStrong                                     : embeddingDirection);                    for (int j = neutralStart; j < i; ++j)                      types[i] = override;                  }                prevStrong = newStrong;                neutralStart = -1;              }          }        previousLevel = level;      }  }