Defensive check switched to checking for empty collection as the HastSet<Strings> keyspaces is always initialised to an empty set