static int addBools(bool... x) { int i = 0; if (x != null) for (bool b : x) if (b) ++i; ret i; }