simplified test (used exception assertion)
reduced indention (#13)
avoid prefixing "*" with variable prefix "?" (#13)
moved imports closure generation (#13)
added generic solution for counting (#13)