code: private static int getContextKey(char c) {
          if (c < contexts[ctCache]) {
              while (ctCache > 0 && c < contexts[ctCache]) --ctCache;
          } else if (c >= contexts[ctCache + 1]) {
              while (ctCache < ctCacheLimit && c >= contexts[ctCache + 1]) ++ctCache;
          }
  
          // if we're not in a known range, then return EUROPEAN as the range key
          return (ctCache & 0x1) == 0 ? (ctCache / 2) : EUROPEAN_KEY;
      }
docs: warning, synchronize access to this as it modifies state