Workaround methods for unchecked casts but allowing using more
appropriate generic collections