added javadoc
added unit test for invalid expression