class DecoratedIcon implements Icon {

    private final Icon orig;
    private final Icon decoration;
    private final DecorationController decorationController;

    public DecoratedIcon(Icon orig, Icon decoration) {
        this.orig = orig;
        this.decoration = decoration;
        this.decorationController = null;
    }

    public DecoratedIcon(Icon orig, Icon decoration, DecorationController decorationController) {
        this.orig = orig;
        this.decoration = decoration;
        this.decorationController = decorationController;
    }

    @Override
    public void paintIcon(Component c, Graphics g, int x, int y) {<FILL_FUNCTION_BODY>}

    @Override
    public int getIconWidth() {
        return orig.getIconWidth();
    }

    @Override
    public int getIconHeight() {
        return orig.getIconHeight();
    }

    public interface DecorationController {

        boolean isDecorated();
    }
}

        orig.paintIcon(c, g, x, y);
        if (decorationController == null || decorationController.isDecorated()) {
            decoration.paintIcon(c, g, x + orig.getIconWidth() - decoration.getIconWidth(), y);
        }
    
<no_super_class>