Field f     = FieldFinder.find(name);
  public void testUseCustomAttributeRequired() {    GrouperSession  s     = null;    String          type  = "customType.TUCAR";    String          name  = "customField.TUCAR";    FieldType       ft    = FieldType.ATTRIBUTE;     Privilege       read  = AccessPrivilege.VIEW;    Privilege       write = AccessPrivilege.UPDATE;    boolean         req   = true;    try {      s = SessionHelper.getRootSession();      GroupType custom = GroupType.createType(s, type);      custom.addField(s, name, ft, read, write, req);      Assert.assertTrue("added ATTRIBUTE field", true);      try {        Field f     = FieldFinder.find(name);        Stem  root  = StemFinder.findRootStem(s);        Stem  edu   = root.addChildStem("edu", "edu");        Group g     = edu.addChildGroup("g", "g");        Assert.assertTrue("no custom type", !g.hasType(custom));        g.addType(custom);        Assert.assertTrue("custom type", g.hasType(custom));        g.setAttribute(name, name);        Assert.assertTrue(          "has attribute",           g.getAttribute(name).equals(name)        );        try {          g.deleteAttribute(name);          Assert.fail("deleted required attribute");        }        catch (Exception e) {          Assert.assertTrue("cannot delete required attribute", true);        }      }      catch (Exception e) {        Assert.fail(e.getMessage());      }    }    catch (InsufficientPrivilegeException eIP) {      Assert.fail("unexpected exception: " + eIP.getMessage());    }    catch (SchemaException eS) {      Assert.fail("unexpected exception: " + eS.getMessage());    }    finally {      SessionHelper.stop(s);    }  } // public void testUseCustomAttributeRequired()