class LanternaThemes {
    private LanternaThemes() {
        // No instantiation
    }

    private static final ConcurrentHashMap<String, Theme> REGISTERED_THEMES = new ConcurrentHashMap<>();

    static {
        // Register the default theme first
        Properties defaultThemeProperties = loadPropTheme("default-theme.properties");
        if (defaultThemeProperties != null) {
            registerPropTheme("default", defaultThemeProperties);
        }
        else {
            // If we couldn't load it from file, use the hard-coded one instead
            registerTheme("default", new DefaultTheme());
        }

        // Now register all bundled themes that are defined in property files (if found)
        registerPropTheme("bigsnake", loadPropTheme("bigsnake-theme.properties"));
        registerPropTheme("businessmachine", loadPropTheme("businessmachine-theme.properties"));
        registerPropTheme("conqueror", loadPropTheme("conqueror-theme.properties"));
        registerPropTheme("defrost", loadPropTheme("defrost-theme.properties"));
        registerPropTheme("blaster", loadPropTheme("blaster-theme.properties"));
    }

    /**
     * Returns a collection of all themes registered with this class, by their name. To get the associated {@link Theme}
     * object, please use {@link #getRegisteredTheme(String)}.
     * @return Collection of theme names
     */
    public static Collection<String> getRegisteredThemes() {
        return new ArrayList<>(REGISTERED_THEMES.keySet());
    }

    /**
     * Returns the {@link Theme} registered with this class under {@code name}, or {@code null} if there is no such
     * registration.
     * @param name Name of the theme to retrieve
     * @return {@link Theme} registered with the supplied name, or {@code null} if none
     */
    public static Theme getRegisteredTheme(String name) {
        return REGISTERED_THEMES.get(name);
    }

    /**
     * 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
     */
    public static void registerTheme(String name, Theme theme) {<FILL_FUNCTION_BODY>}

    /**
     * Returns lanterna's default theme which is used if no other theme is selected.
     * @return Lanterna's default theme, as a {@link Theme}
     */
    public static Theme getDefaultTheme() {
        return REGISTERED_THEMES.get("default");
    }

    private static void registerPropTheme(String name, Properties properties) {
        if(properties != null) {
            registerTheme(name, new PropertyTheme(properties, false));
        }
    }

    private static Properties loadPropTheme(String resourceFileName) {
        Properties properties = new Properties();
        try {
            ClassLoader classLoader = AbstractTextGUI.class.getClassLoader();
            InputStream resourceAsStream = classLoader.getResourceAsStream(resourceFileName);
            if(resourceAsStream == null) {
                resourceAsStream = new FileInputStream("src/main/resources/" + resourceFileName);
            }
            properties.load(resourceAsStream);
            resourceAsStream.close();
            return properties;
        }
        catch(IOException e) {
            // Failed to load theme, return null
            return null;
        }
    }
}

        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 + "'");
        }
    
<no_super_class>