class BrandUtil {

    private BrandUtil() {}

    public static void applyBrand(Injector injector, Stage stage) {
        applyBrand(injector, stage, stage.getScene());
    }
    
    public static void applyBrand(Injector injector, Stage stage, Scene scene) {
        applyBrandToStage(injector, stage);
        
        final Brand brand        = injector.getOrThrow(Brand.class);
        final InfoComponent info = injector.getOrThrow(InfoComponent.class);
        
        apply(brand, info, stage, scene);
    }
    
    public static void applyBrandToStage(Injector injector, Stage stage) {
        final InfoComponent info = injector.getOrThrow(InfoComponent.class);
        final Brand brand = injector.getOrThrow(Brand.class);
        
        stage.setTitle(info.getTitle());
        brand.logoSmall()
            .map(Image::new)
            .ifPresent(stage.getIcons()::add);
    }
    
    public static void applyBrandToScene(Injector injector, Scene scene) {<FILL_FUNCTION_BODY>}
    
    private static void apply(Brand brand, InfoComponent info, Stage stage, Scene scene) {
        if (stage != null) {
            stage.setTitle(info.getTitle());
        }
        
        brand.logoSmall()
            .map(Image::new)
            .ifPresent(icon -> {
                if (stage != null) {
                    stage.getIcons().add(icon);
                }

                @SuppressWarnings("unchecked")
                final Stage dialogStage = (Stage) scene.getWindow();
                if (dialogStage != null) {
                    dialogStage.getIcons().add(icon);
                }
            });

        brand.stylesheets().forEachOrdered(scene.getStylesheets()::add);
    }

}

        final Brand brand               = injector.getOrThrow(Brand.class);
        final UserInterfaceComponent ui = injector.getOrThrow(UserInterfaceComponent.class);
        final InfoComponent info        = injector.getOrThrow(InfoComponent.class);
        
        final Stage stage = scene.getWindow() == null 
            ? ui.getStage() 
            : (Stage) scene.getWindow();
        
        apply(brand, info, stage, scene);
    
<no_super_class>