New Jersey offers a potential blueprint for densely populated states that are grappling with increased flooding due to climate change.