code: protected Integer compareNullObjects(Object object1, Object object2) {
          if ((object1 == null) && (object2 == null)) {
              return 0;
          }
          if (object1 == null) {
              return 1;
          }
          if (object2 == null) {
              return -1;
          }
          return null;
      }
docs: Checks for null objects and returns the proper result depedning on which
  object is null
  
  @param object1
  @param object2
  @return <ol> <li>0 = field null or both objects null</li> <li>1 = object1
  is null</li> <li>-1 = object2 is null</li> <li>null = both objects are
  not null</li> </ol>