### Question:
BaseService { protected boolean hasPerm(User operateUser, int createUserId) { return operateUser.getId() == createUserId || isAdmin(operateUser); }  static Cookie getCookie(HttpServletRequest request, String name);  }### Answer:
@Test public void testHasPerm(){ User user = new User(); user.setId(1); boolean hasPerm = baseService.hasPerm(user,1); Assert.assertTrue(hasPerm); user.setId(2); user.setUserType(UserType.ADMIN_USER); hasPerm = baseService.hasPerm(user,1); Assert.assertTrue(hasPerm); }