fix degenerate map broken test
refactor flat map tests