An existing system written in Java uses the hashcode of a string as its routing strategy for load balancing.
Now, I cannot modify the system but ne
String s = "Some String" for (int i = 0; i < SOME_VERY_BIG_NUMBER; ++i) { String copy = new String(s); // Do something with copy. }
Will this work for you? It just creates a lot of copies of the same String literal that you can then use in your testing.