Fix warnings
Extract test utils methods
Fix PMD & FindBugs warnings