@Override
  public void setConf(Configuration conf) {
    this.conf = conf;
    uid = conf.getInt(UID, 0);
    user = conf.get(USER);
    if (null == user) {
      try {
        user = UserGroupInformation.getCurrentUser().getShortUserName();
      } catch (IOException e) {
        user = "hadoop";
      }
    }
    gid = conf.getInt(GID, 1);
    group = conf.get(GROUP);
    if (null == group) {
      group = user;
    }

    resetUGInfo();
    addUser(user, uid);
    addGroup(group, gid);
  }
@Test(expected=IllegalStateException.class)
  public void testDuplicateIds() {
    Configuration conf = new Configuration(false);
    conf.setInt(SingleUGIResolver.UID, 4344);
    conf.setInt(SingleUGIResolver.GID, 4344);
    conf.set(SingleUGIResolver.USER, TESTUSER);
    conf.set(SingleUGIResolver.GROUP, TESTGROUP);
    ugi.setConf(conf);
    ugi.ugiMap();
  }