Fixed Advanced.java example.
Added distirbution to pom.xml.
Optimized validation (made typesafe and return parameter which is checked).