<commit_before>package com.hyperfresh.mchyperchat;

import java.util.HashMap;
import java.util.Map;

public class ThemeManager
{
	private final Map<String, Theme> themes = new HashMap<>();

	private final Map<Class<? extends Theme>, Theme> themesByClass = new HashMap<>();

	/**
	 * The theme to use as the default.
	 */
	private final Theme defaultTheme = new VanillaTheme();

	public ThemeManager()
	{
		add(defaultTheme);
	}

	public void add(Theme theme)
	{
		themes.put(theme.getID(), theme);
		themesByClass.put(theme.getClass(), theme);
	}

	public Theme get(String id)
	{
		return themes.get(id);
	}

	public Theme getDefaultTheme()
	{
		return defaultTheme;
	}

	public <E extends Theme> E get(Class<E> themeClass)
	{
		return (E)themesByClass.get(themeClass);<commit_msg>replace add(Theme) with add(String, Theme) and also added addAll() method<commit_after>package com.hyperfresh.mchyperchat;

import java.util.HashMap;
import java.util.Map;

public class ThemeManager
{
	private final Map<String, Theme> themes = new HashMap<>();

	private final Map<Class<? extends Theme>, Theme> themesByClass = new HashMap<>();

	/**
	 * The theme to use as the default.
	 */
	private final Theme defaultTheme = new VanillaTheme();

	public ThemeManager()
	{
		add("vanilla", defaultTheme);
	}

	public void add(String ID, Theme theme)
	{
		themes.put(ID, theme);
		themesByClass.put(theme.getClass(), theme);
	}

	public void addAll(Map<String, Theme> themes)
	{
		this.themes.putAll(themes);
		themes.values().stream().forEach(theme -> this.themesByClass.put(theme.getClass(), theme));
	}

	public Theme get(String id)
	{
		return themes.get(id);
	}

	public Theme getDefaultTheme()
	{
		return defaultTheme;
	}

	public <E extends Theme> E get(Class<E> themeClass)
	{
		return (E)themesByClass.get(themeClass);
{'fraction_non_alphanumeric': 0.13031474323578135, 'fraction_numerical': 0.0, 'mean_word_length': 4.575384615384616, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2273435', 'n_tokens_mistral': 623, 'n_tokens_neox': 580, 'n_words': 158}