code: public static int getSize (Object[] list)
      {
          int size = 0;
          for (int ii = 0, nn = (list == null) ? 0 : list.length; ii < nn; ii++) {
              if (list[ii] != null) {
                  size++;
              }
          }
          return size;
      }
docs: Returns the number of non-null elements in the supplied list.