public TransliteratorInstance getInstance(String id) {
    try {
      Class<?> cls = classLoader.loadClass("com.ibm.icu.text.Transliterator");
      Method getInstance = cls.getMethod("getInstance", String.class);
      Object t = getInstance.invoke(null, id);
      Method transform = cls.getMethod("transliterate", String.class);
      return str -> {
        try {
          return (String) transform.invoke(t, str);
        } catch (IllegalAccessException | InvocationTargetException e) {
          throw new IllegalStateException(e);
        }
      };
    } catch (ClassNotFoundException | InvocationTargetException | NoSuchMethodException | IllegalAccessException |
      ExceptionInInitializerError e) {
      if (!loggedOnce.get() && loggedOnce.compareAndSet(false, true)) {
        LOGGER.warn("Could not get thread-local transliterator, falling back to slower shared instance: {}",
          e.toString());
      }
      Transliterator t = Transliterator.getInstance(id);
      return t::transliterate;
    }
  }
Returns a {@link com.ibm.icu.text.Transliterator} for {@code id} that does not share any data with transliterators
on other threads.
planetiler-core/src/main/java/com/onthegomap/planetiler/util/ThreadLocalTransliterator.java