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; }  ValidatorChain validatePermisionAdd(LoginUser user, UserGroup userGroup, Errors errors); ValidatorChain validatePermisionUpdateAndDelete(LoginUser user, UserGroup userGroup, Errors errors); boolean canOpterateGroupMember(Long userId, Long currentGroupId); boolean isUserInGroup(Long userId, Long groupId); ListResult<MemberView> findGroupMemberPageList(Paging<UserGroup> paging);  }
@Test public void isUserInGroupTest() throws Exception { Assert.assertTrue(groupMemberService.isUserInGroup(1L, 1L)); }