Added iterator logic for HashMap and HashSet.