EasyMock.<Collection<? extends GrantedAuthority>>expect(mockAuthentication.getAuthorities()).andReturn(grantedAuthoritiesList).anyTimes();
expect(mockAuthentication.getPrincipal()).andReturn(user).anyTimes();
replay(mockAuthentication);
WidgetComment localWidgetComment = new WidgetCommentImpl();
UserImpl localUser = new UserImpl();
localUser.setId(VALID_USER_ID);
localWidgetComment.setUserId(VALID_USER_ID);
expect(widgetRepository.getCommentById(null, VALID_COMMENT_ID)).andReturn(localWidgetComment).anyTimes();
replay(widgetRepository);
assertThat(defaultWidgetCommentPermissionEvaluator.hasPermission(mockAuthentication, localWidgetComment, Permission.CREATE), is(true));