private void assertUserGroup(User user, ImmutableSet<String> groups) {
    assertNotNull("GroupNames should be not null", user.getGroupNames());
    assertTrue("UserGroupNames length should be == " + groups.size(),
      user.getGroupNames().length == groups.size());

    for (String group : user.getGroupNames()) {
      assertTrue("groupName should be in set ", groups.contains(group));
    }
  }
Make sure that we're returning a result for the current user. Previously getCurrent() was
returning null if not initialized on non-secure Hadoop variants.
hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestUser.java