title: Java method contains another method that throws exception
body: <p>I have public method <code>add(String)</code> that calls private method <code>inspectSequence(String)</code> to check whether String valid or not. </p>
  
  <p>This method returns array if passed <code>String</code> is valid, if it's invalid then method throws <code>IllegalArgumentException</code></p>
  
  <p>the code is next</p>
  
  <pre><code>public void add(String sequence) throws IllegalArgumentException{
    inspectSequence(sequence);
  }
  
  private int[] inspectSequence(String sequence){
    int[] array;
    //some actions
    if(&lt;some condition&gt;) throw new IllegalArgumentException("description");
    return array;
  }
  </code></pre>
  
  <p>So in cases, when invalid <code>String</code> were passed to <code>add</code> method output will be next:</p>
  
  <pre><code>java.lang.IllegalArgumentException: description
  at inspectSequence
  at add
  </code></pre>
  
  <p>But I don't want user to know about private <code>inspectSequence</code> method because this is realization detail, right?</p>
  
  <p>So what I can do in that case? Is it a good idea to throw unchecked exception here? </p>
  
  <p>And is a good idea to throw exception inside <code>inspectSequence</code> method or I should return <code>null</code> when supplied <code>String</code> isn't valid and then check returned result in <code>add</code> method and depending on it throw or not throw exception?</p>