private static Preferences getPreferences(String key) {
    Preferences prefs = Preferences.userRoot();
    final int dotIndex = key.lastIndexOf('.');
    if (dotIndex > 0) {
      StringTokenizer tokenizer = new StringTokenizer(key.substring(0, dotIndex), ".", false);
      while (tokenizer.hasMoreElements()) {
        String str = tokenizer.nextToken();
        prefs = prefs.node(str == null ? null : str.toLowerCase(Locale.ENGLISH));
      }
    }
    return prefs;
  }
private static Preferences getPreferences(String key)