Set intersection implementation and test