That is not going to work. If in the loop an IllegalStateException is thrown, your test will succeed.