class GroupMemberService {

    public boolean isUserInGroup(Long userId, Long groupId) throws SQLException {
        List<UserGroup> ugGroups = userGroupDao.getUserGroupByUserId(userId);
        if (CollectionUtils.isNotEmpty(ugGroups)) {
            return ugGroups.stream().anyMatch(_userGroup -> _userGroup.getGroup_id().equals(groupId));
        }
        return false;
    }

}