code: static DayPeriod of(
          Locale locale,
          String calendarType
      ) {
  
          String lang = locale.getLanguage(); // NPE-check
  
          if (lang.equals("nn")) {
              locale = new Locale("nb"); // CLDR 29 contains no data for language nn
          }
  
          Map<String, String> resourceMap = loadTextForms(locale, calendarType);
          SortedMap<PlainTime, String> codeMap = Collections.emptySortedMap();
  
          for (String key : resourceMap.keySet()) {
              if (accept(key)) {
                  int hour = Integer.parseInt(key.substring(1, 3));
                  int minute = Integer.parseInt(key.substring(3, 5));
                  PlainTime time = PlainTime.midnightAtStartOfDay();
                  if (hour == 24) {
                      if (minute != 0) {
                          throw new IllegalStateException("Invalid time key: " + key);
                      }
                  } else if ((hour >= 0) && (hour < 24) && (minute >= 0) && (minute < 60)) {
                      time = time.plus(hour * 60 + minute, ClockUnit.MINUTES);
                  } else {
                      throw new IllegalStateException("Invalid time key: " + key);
                  }
                  if (codeMap.isEmpty()) {
                      codeMap = new TreeMap<>();
                  }
                  codeMap.put(time, resourceMap.get(key));
              }
          }
  
          if (codeMap.isEmpty() || lang.isEmpty()) {
              return FALLBACK;
          }
  
          Iterator<PlainTime> iter = codeMap.keySet().iterator();
          String oldCode = "";
  
          while (iter.hasNext()) {
              PlainTime time = iter.next();
              String code = codeMap.get(time);
              if (code.equals(oldCode)) {
                  iter.remove(); // lex colombia
              } else {
                  oldCode = code;
              }
          }
  
          return new DayPeriod(locale, calendarType, codeMap);
  
      }
docs: package-private because used in deserialization