public List<Theme> getThemes(long companyId, long groupId, long userId, boolean wapTheme)
      throws SystemException {

    List<Theme> themes = getThemes(companyId);

    themes = PluginUtil.restrictPlugins(themes, companyId, userId);

    Iterator<Theme> itr = themes.iterator();

    while (itr.hasNext()) {
      Theme theme = itr.next();

      if (theme.getThemeId().equals("controlpanel")
          || !theme.isGroupAvailable(groupId)
          || (theme.isWapTheme() != wapTheme)) {

        itr.remove();
      }
    }

    return themes;
  }