class FacetRegistry {

    @SuppressWarnings("unchecked")
    <T> List<T> getFacets(@Nullable Class<T> facet)
    {
        if (facet != null && Plugin.class.isAssignableFrom(facet))
        {
            List<T> ts = new ArrayList<>();
            Plugin plugin = pluginsByClass.get(facet);
            if (plugin != null)
            {
                ts.add((T) plugin);
            }
            return ts;
        }
        return (List<T>) pluginsByFacet.get(facet);
    }

      FacetRegistry(final Collection<Plugin> plugins);

}