so, here's the problem with the robustness of this. The array is only built once if it is empty or not. So, what happens if there are a bunch of external ids added, then an internal id looked up (which instantiates the array), and then again an external id is added?

One way out of this is to call out the distinct phases we are interested in separately so that the interface of NodeRenumberer is more robust -- i.e., an API to just add or lookup a new external node id, an API to instantiate the internal id mappings, and then you won't have to do this instantiation "under the hood". There might be other ways out of this...