TMDM-7865: "Incorrect warning when use inherited mode type."

Fix incorrect warning when a super type is never use and only sub types are used.
Adds unit test for issue.
(https://jira.talendforge.org/browse/TMDM-7865)