You can <code> assert(count < max); </code> in fact, rather than testing on it !