code: public static void registerTheme(String name, Theme theme) {
          if(theme == null) {
              throw new IllegalArgumentException("Name cannot be null");
          }
          else if(name.isEmpty()) {
              throw new IllegalArgumentException("Name cannot be empty");
          }
          Theme result = REGISTERED_THEMES.putIfAbsent(name, theme);
          if(result != null && result != theme) {
              throw new IllegalArgumentException("There is already a theme registered with the name '" + name + "'");
          }
      }
docs: Registers a {@link Theme} with this class under a certain name so that calling
  {@link #getRegisteredTheme(String)} on that name will return this theme and calling
  {@link #getRegisteredThemes()} will return a collection including this name.
  @param name Name to register the theme under
  @param theme Theme to register with this name