The documentation does not explain that it is necessary to call StubServer.start() before StubServer.getLocalPort()
A NullpointerException arises if these are in the wrong order (line 197).
It would be nicer to throw an IllegalStateException intead, explaining what's wrong.