code: public void setTheme(final Theme theme) {
          if (this.themeReference != null || this.themeUrl != null) {
              throw new IllegalStateException(
                      "A theme can only be defined once. Calling different setTheme methods is not allowed!");
          }
          this.theme = theme;
      }
docs: Sets the theme for this chart by specifying a theme class.
  
  A theme can only be set via one setTheme method. An
  {@link IllegalStateException} will be thrown if you call two setTheme
  methods.
  
  @param theme the theme class.