@RequiresSession
  public Set<ConfigGroupHostMapping> findByGroup(final Long groupId) {

    populateCache();

    Set<ConfigGroupHostMapping> result = new HashSet<>();

    for (Set<ConfigGroupHostMapping> item : configGroupHostMappingByHost.values()) {

      Set<ConfigGroupHostMapping> setByHost = new HashSet<>(item);

      CollectionUtils.filter(setByHost, new Predicate() {

        @Override
        public boolean evaluate(Object arg0) {
          return ((ConfigGroupHostMapping) arg0).getConfigGroupId().equals(groupId);
        }
      });

      result.addAll(setByHost);

    }

    return result;

  }
Return entity object which can be used for operations like remove
directly.
@param configGroupHostMappingEntityPK
@return
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ConfigGroupHostMappingDAO.java