if ((receiver == null) || !(receiver instanceof Asset)) {
if (receiver == null) receiverID = UNKNOWN; else if (receiver instanceof String) receiverID = (String) receiver; else if (!(receiver instanceof Asset)) {
  protected void addContentsInfo(GLMAsset container, ArrayList agglist) {    ArrayList typeIDs = new ArrayList();    ArrayList nomenclatures = new ArrayList();    ArrayList weights = new ArrayList();    ArrayList receivers = new ArrayList();    for (Iterator iterator = agglist.iterator();         iterator.hasNext();) {      Task task = (Task) iterator.next();      TypeIdentificationPG typeIdentificationPG =         task.getDirectObject().getTypeIdentificationPG();      String typeID;      String nomenclature;      if (typeIdentificationPG != null) {        typeID = typeIdentificationPG.getTypeIdentification();        if ((typeID == null) || (typeID.equals(""))) {          typeID = UNKNOWN;        }                 nomenclature = typeIdentificationPG.getNomenclature();        if ((nomenclature == null) || (nomenclature.equals(""))) {          nomenclature = UNKNOWN;        }      } else {        typeID = UNKNOWN;        nomenclature = UNKNOWN;      }      typeIDs.add(typeID);      nomenclatures.add(nomenclature);            double quantity = task.getPreferredValue(AspectType.QUANTITY);      Mass mass = Mass.newMass(quantity, Mass.SHORT_TONS);       weights.add(mass);            Object receiver =         task.getPrepositionalPhrase(Constants.Preposition.FOR);      String receiverID;              // Add field with recipient      if ((receiver == null) || !(receiver instanceof Asset)) {        receiverID = UNKNOWN;      } else {        ItemIdentificationPG itemIdentificationPG =           ((Asset) receiver).getItemIdentificationPG();        if ((itemIdentificationPG == null) ||            (itemIdentificationPG.getItemIdentification() == null) ||            (itemIdentificationPG.getItemIdentification().equals(""))) {          receiverID = UNKNOWN;        } else {          receiverID = itemIdentificationPG.getItemIdentification();        }      }      receivers.add(receiverID);    }        // Contents    NewContentsPG contentsPG =       PropertyGroupFactory.newContentsPG();    contentsPG.setNomenclatures(nomenclatures);    contentsPG.setTypeIdentifications(typeIDs);    contentsPG.setWeights(weights);    contentsPG.setReceivers(receivers);    container.setContentsPG(contentsPG);  }