public int compare(Object o1, Object o2) {
      Object val1;
      Object val2;
      String comparePropertyName;
      int result = 0;

      for(int i=0; i < comparePropertyNames.size(); i++) {
         comparePropertyName = (String) comparePropertyNames.get(i);

         val1 = getObjectPropertyValue(o1,comparePropertyName);
         val2 = getObjectPropertyValue(o2,comparePropertyName);

         if(val1 == null && val2 == null) {
            result = 0;//equal
         } else if(val1 == null) {
            result = 1;//put after 2nd
         } else if(val2 == null) {
            result = -1;//put before 2nd
         } else {
            result = ((Comparable) val1).compareTo(val2);//compare objects
         }

         if(result != 0) {
            break;
         }
      }
      return result;
   }