code: public static <T extends MVec> int count(T[] beliefs) {
          int count = 0;
          if (beliefs != null) {
              for (int i = 0; i < beliefs.length; i++) {
                  if (beliefs[i] != null) {
                      count += beliefs[i].size();
                  }
              }
          }
          return count;
      }
docs: Java seems confused by. This is similar to the way the JDK handles Arrays.copyOf().