}   else if (pol == p) { return true;
  private boolean isConflict(LogisticsPolicy lp) {    Policy p = lp.getPolicy();    Enumeration pols = allPolicies_.elements();    boolean match = false;    Policy matchPol = null;    //see if the type of policy in question has been published already    while(pols.hasMoreElements()){      Policy pol = (Policy) pols.nextElement();      if (pol.getName().equals(p.getName()) && pol != p){        match = true;        matchPol = pol;      }    }    if (match == true){      boolean eq = false;      LogisticsPolicy matchLP = null;      //if so, check to see if the policy has a corresponding LogisticsPolicy      //if not, the policy was fed in at the agent itself and that agent becomes the authority      Enumeration lps = sub.elements();      while (lps.hasMoreElements()){        LogisticsPolicy curLP = (LogisticsPolicy) lps.nextElement();        if (curLP.getPolicy().equals(matchPol)){          eq = true;          matchLP = curLP;        }      }      if (eq == false){        Enumeration comlps = comSub.elements();        while (comlps.hasMoreElements()){          LogisticsPolicy curLP = (LogisticsPolicy) comlps.nextElement();          if (curLP.getPolicy().equals(matchPol)){            eq = true;            matchLP = curLP;          }        }      }      if (matchLP != null && matchLP.getPolicy().equals(lp.getPolicy())) eq = false;      //get instance of Organization that is source of each Policy      if (eq == true){        //conflict -- if true, remove matchLP        if (matchLP.getAuthority().equals(lp.getAuthority())){          getBlackboardService().publishRemove(matchLP);          getBlackboardService().publishRemove(matchPol);          return false;        } else if ((matchLP.getSource() != null && lp.getSource() != null) && matchLP.getSource().equals(lp.getSource())){          getBlackboardService().publishRemove(matchLP);          getBlackboardService().publishRemove(matchPol);          return false;        } else {          Enumeration orgs = allOrganizations_.elements();          Organization newOrg = null;          Organization oldOrg = null;          while (orgs.hasMoreElements()){            Organization o = (Organization) orgs.nextElement();            if (lp.getSource() == null) {              newOrg = myOrganization_;            }else if (lp.getSource().toString().equals(o.getItemIdentificationPG().getItemIdentification())){              newOrg = o;            }            if (matchLP.getSource().toString().equals(o.getItemIdentificationPG().getItemIdentification())){              oldOrg = o;            }          }          if (oldOrg == null && !(matchLP.getSource().toString().equals(myOrgName_) && newOrg == null)){            if (matchLP != null && (!matchLP.getRole().equals("Subordinate") || (matchLP.getRole().equals("Subordinate") && lp.getRole().equals("Subordinate")))) {              //					if (matchLP != null && !matchLP.getRole().equals("Subordinate")){              getBlackboardService().publishRemove(matchLP);            }            if (matchPol != null) {              getBlackboardService().publishRemove(matchPol);            }            return false;          } else if (newOrg != null) {            MutableTimeSpan mts = new MutableTimeSpan ();            Collection sups = myOrganization_.getSuperiors(mts.getStartTime(), mts.getEndTime());            /***********/            boolean containsOldOrg = false;            for(Iterator i = sups.iterator(); i.hasNext();){              RelationshipImpl ri = (RelationshipImpl) i.next();              Organization oa = (Organization) ri.getA();              Organization ob = (Organization) ri.getB();              if (oa.equals(newOrg) || ob.equals(newOrg)) {                getBlackboardService().publishRemove(matchLP);                getBlackboardService().publishRemove(matchPol);                return false;              } else if (oa.equals(oldOrg) || ob.equals(oldOrg)) {                containsOldOrg = true;              }            }            if (containsOldOrg == false) {              getBlackboardService().publishRemove(matchLP);              getBlackboardService().publishRemove(matchPol);              return false;            }          }        }        //if there is no LP match for previous Policy, that means Policy was injected locally        //so check new LP to see if the source is the Organization's superior      } else {        Enumeration orgs = allOrganizations_.elements();        Organization newOrg = null;        while (orgs.hasMoreElements()){          Organization o = (Organization) orgs.nextElement();          if (lp.getSource() != null && lp.getSource().toString().equals(o.getItemIdentificationPG().getItemIdentification())){            newOrg = o;          }        }        if (newOrg != null) {          MutableTimeSpan mts = new MutableTimeSpan ();          Collection sups = myOrganization_.getSuperiors(mts.getStartTime(), mts.getEndTime());          for(Iterator i = sups.iterator(); i.hasNext();){            RelationshipImpl ri = (RelationshipImpl) i.next();            Organization oa = (Organization) ri.getA();            Organization ob = (Organization) ri.getB();            if (oa.equals(newOrg) || ob.equals(newOrg)) {              getBlackboardService().publishRemove(matchPol);              return false;            }          }        }      }    }else {      return false;    }    //check this    if (lp != null && lp.getSource() != null && !lp.getSource().toString().equals(myOrgName_)) {      //needs to be a check here      getBlackboardService().publishRemove(lp);    }    return true;  }