title: Generate a String for a given size
body: <p>How can I generate a String of a given size?</p>
  
  <pre><code>int someLimit = GlobalLimits.BULK_SIZE;
  </code></pre>
  
  <p>I want 3 Strings which satisfy the below conditions.</p>
  
  <h2>- RandomStr.length &lt; someLimit.length</h2>
  
  <h2>- RandomStr.length = someLimit.length</h2>
  
  <h2>- RandomStr.length > someLimit.length</h2>
  
  <p>This is what I have tried so far.</p>
  
  <pre><code>private String getLowerRandomString(int upto){
    StringBuilder sBuilder = new StringBuilder();
    for (int i = 0; i &lt; upto; i++){
      sBuilder.append("A");
    }
  
    return sBuilder.toString();
  }
  </code></pre>
  
  <p><strong>The problem what I see is</strong>, if my limit = 10000, it still loop up-to 9999 which is unnecessary. Share if you know a better approach than this. Thank you.</p>
  
  <hr>
  
  <p>FYI:
  I was writing a unit test for a simple helper method. </p>
  
  <pre><code>public boolean isBulk(String text){
   int bulkLimit = ImportToolkit.getSizeLimit();
   if (text != null &amp;&amp; text.length() &gt; bulkLimit){
    return true;
   }
   return false;
  }
  </code></pre>
  
  <p>So, I want to pass different sizes of strings as parameters to this method and want to assert whether it gives me expected results.</p>