endsWith would be better. Otherwise commands like "NewUICommandCommand" or "NewUICommandWizard" will be wrongly resolved. Add these input as a test for this method (it can be static and package-private, so you can access directly from your test class).