public DirectoryObjectList(JSONArray array) {
   directoryObjectList = new ArrayList<S>();
   for (int i = 0; i < array.length(); i++) {
     S directoryObject = null;
     try {
       JSONHelper.convertJSONObjectToDirectoryObject(array.optJSONObject(i), directoryObject);
     } catch (SdkException e) {
       e.printStackTrace();
     }
     directoryObjectList.add(directoryObject);
   }
 }
  public String getAccessToken() {
    if (accessToken == null) {

      String token = "";
      try {
        token =
            TokenGenerator.GetTokenFromUrl(
                SdkConfig.acsUrl,
                this.getTenantContextId(),
                this.getAppPrincipalId(),
                SdkConfig.PROTOCOL_NAME + "://" + SdkConfig.protectedResourceHostName,
                this.getPassword());
      } catch (SdkException e) {
        e.getCause().printStackTrace();
        System.exit(1);
      }
      this.setAccessToken(token);
    }
    return accessToken;
  }