Fix warnings

* Fix improper/sub-optimal generics usage
* Call static method directly, not through instance
* Improved specification of compiler arguments in pom.xml

After this change, the project builds without warnings even with `-Xlint -Xlint:-serial`.