code: protected void setupExtendsReferences(String appMessageName, List<String> extendsNameList, Locale locale,
              MessageResourceBundle appBundle) {
          final TreeSet<MessageResourceBundle> hierarchySet = new TreeSet<MessageResourceBundle>();
          final MessageResourceBundle wrappedAppBundle = wrapBundle(appMessageName, appBundle, null);
          hierarchySet.addAll(convertToHierarchyList(wrappedAppBundle));
          int extendsLevel = 1;
          for (String extendsName : extendsNameList) {
              final MessageResourceBundle extendsBundle = findBundleSimply(extendsName, locale);
              final MessageResourceBundle wrappedExtendsBundle = wrapBundle(extendsName, extendsBundle, extendsLevel);
              hierarchySet.addAll(convertToHierarchyList(wrappedExtendsBundle));
              ++extendsLevel;
          }
          for (MessageResourceBundle bundle : hierarchySet) {
              bundle.setParent(null); // initialize
          }
          MessageResourceBundle previousBundle = null;
          for (MessageResourceBundle bundle : hierarchySet) {
              if (previousBundle != null) {
                  previousBundle.setParent(bundle);
              }
              previousBundle = bundle;
          }
      }
docs: Set up extends references to the application bundle. <br>
  @param appMessageName The message name for application properties. (NotNull)
  @param extendsNameList The list of message name for extends properties. The first element is first extends (NotNull)
  @param locale The locale of current request. (NotNull)
  @param appBundle The bundle for application that does not set up extends handling yet. (NotNull)