title: How to produce random Basic Multilingual Plane (BMP) strings in Java?
body: <p>I'm using <code>RandomStringGenerator</code> from <code>commons-text</code> 1.2-SNAPSHOT to produce random user names and passwords for tests. Using those generated strings in Selenium with Chrome driver can cause</p>
  
  <pre><code>org.openqa.selenium.WebDriverException: 
  unknown error: ChromeDriver only supports characters in the BMP
    (Session info: chrome=62.0.3202.62)
    (Driver info: chromedriver=2.33.506092 (733a02544d189eeb751fe0d7ddca79a0ee28cce4),platform=Linux 4.13.0-16-generic x86_64) (WARNING: The server did not provide any stacktrace information)
  </code></pre>
  
  <p>Is there any way to produce <a href="https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_Multilingual_Plane" rel="nofollow noreferrer">BMP</a> strings with existing functions already or do I have to go the obvious way to research all BMP codepoints to select randomly from them and risk to reinvent the wheel.</p>
  
  <p>Not a duplicate of <a href="https://stackoverflow.com/questions/31709140/how-to-handle-org-openqa-selenium-webdriverexception-chromedriver-only-support">How to handle &quot;org.openqa.selenium.WebDriverException: ChromeDriver only supports characters in the BMP&quot; exception?</a> since I'm interested in the solution for other purposes as well.</p>