I have a list containing different commands all implemented the same interface (ICommand). These commands are each classes containing information on what the spesific command should do.
I want to be able to tell if the list contains two spesific commands, and do something if they appear together.
For example:
List<ICommand> commandList = getCommandList(); // not important how the list is made
pseudo code comming up:
if ( commandList contains HelpCommand.class && WriteHelpToFileCommand.class )
then do something (write the help to a file)
else do something else (print the help to console)
Can someone point me in the right direction?