Fix some IntelliJ and JavaDoc warnings and avoid code-duplication and duplicated test-methods Adjust tests slighlty, close resources