JUnitTests
+ some optimization