Extracted a method.
Added test cases for InputMapping.