The PatternRecognizer constructor should take an Iterable, not a Map. The Map functionality is only used by the CreateFooRecognizer functions. PatternRecognizer just needs an Iterable of .
Might also want to come up with a less generic name for the Item interface.