class GroupService {

    public boolean isInCurrentGroup(Long userId, int currentGroupId) throws SQLException {
        List<UserGroup> urgroups = userGroupDao.getUserGroupByUserId(userId);
        if (CollectionUtils.isNotEmpty(urgroups) && urgroups.stream().anyMatch(ug -> ug.getUser_id() == currentGroupId)) {
            return true;
        }
        return false;
    }

}