EasyMock.<Collection<? extends GrantedAuthority>>expect(mockAuthentication.getAuthorities()).andReturn(grantedAuthoritiesList).anyTimes();
expect(mockAuthentication.getPrincipal()).andReturn(user).anyTimes();
replay(mockAuthentication);
WidgetComment localWidgetComment = new WidgetComment();
User localUser = new User();
localUser.setEntityId(VALID_USER_ID);
localWidgetComment.setUser(localUser);
expect(mockWidgetCommentRepository.get(VALID_COMMENT_ID)).andReturn(localWidgetComment).anyTimes();
replay(mockWidgetCommentRepository);
assertThat(defaultWidgetCommentPermissionEvaluator.hasPermission(mockAuthentication, localWidgetComment, Permission.CREATE), is(true));