Add unit tests for the new -optional-element-type command-line switch