[JAVA] Add option for repeteable multithread runs

- Reimplement different cell behaviors for singlethread,
non-repeteable multithread and repeteable multithread
using the strategy design pattern.
- Use foreach instead of for with explicit iterators.