Added support for Collection type in addition to List and Set.