### Question:
RetryingSolrServer extends SolrClient { protected String getExceptionKey(Throwable exception) { return normalizeExceptionKey(exception.toString()); } RetryingSolrServer(SolrClient solrServer, 
                            RetryPolicyFactory retryPolicyFactory, 
                            MetricsFacade metrics); final SolrClient getUnderlyingSolrServer(); @Override NamedList<Object> request(final SolrRequest request, String collection); @Override DocumentObjectBinder getBinder(); @Override void close();  }### Answer:
@Test public void testGetExceptionKey() throws Exception { assertEquals(" UnknownHostException: <redacted>.foo.bar.com ", getExceptionKey(" UnknownHostException: vb0706.foo.bar.com ")); assertEquals(" collection: collection1 slice: shard<redacted> ", getExceptionKey(" collection: collection1 slice: shard130 ")); assertEquals(" _SHARD<redacted>_REPLICA<redacted> ", getExceptionKey(" _SHARD110_REPLICA3 ")); assertEquals("Xhttps: assertEquals("Xhttp: assertEquals("Xhttp: assertEquals("Xhttp: assertEquals("Xhttp%3A%2F%2F<redacted>.foo.bar.com]", getExceptionKey("Xhttp%3A%2F%2Fvb0706.foo.bar.com]")); assertEquals("ftp: assertEquals("Ftp+-.: assertEquals("insertAndQueryTweets_shard<redacted>_replica<redacted>", getExceptionKey("insertAndQueryTweets_shard30_replica3")); assertEquals("foo bar", getExceptionKey("foo bar")); assertEquals("foo bar", getExceptionKey("foo\nbar")); assertEquals("foo bar", getExceptionKey("foo\n\tbar")); assertEquals("IOException msg", getExceptionKey("java.io.IOException msg")); String str; assertEquals(str = "Xhttps:/vb0706.foo.bar.com:8983y", getExceptionKey(str)); assertEquals(str = ": assertEquals(str = "foo", getExceptionKey(str)); }