Update ComponentTest.java

There is no point in using an iterator, this is also a lot faster.