code: public String getDivisionName(ProposalDevelopmentDocumentContract pdDoc) {
          String divisionName = null;
          if (pdDoc != null && pdDoc.getDevelopmentProposal().getOwnedByUnit() != null) {
              UnitContract ownedByUnit = pdDoc.getDevelopmentProposal().getOwnedByUnit();
              // traverse through the parent units till the top level unit
              while (ownedByUnit.getParentUnit() != null) {
                  ownedByUnit = ownedByUnit.getParentUnit();
              }
              divisionName = ownedByUnit.getUnitName();
              if (divisionName.length() > DIVISION_NAME_MAX_LENGTH) {
                  divisionName = divisionName.substring(0, DIVISION_NAME_MAX_LENGTH);
              }
          }
          return divisionName;
      }
docs: This method is to get division name using the OwnedByUnit and traversing through the parent units till the top level
  
  @param pdDoc Proposal development document.
  @return divisionName based on the OwnedByUnit.