More javadocs.
Added basic unit tests for all restrictions.