title: check if a line is valid or not in Java
body: <p>I would like to perform checking on the following:</p>
  
  <pre><code>VALID LINES;
  /**/ some code
  */ some code   /** dsfsdkf sd**/
  
  NOT VALID LINES;
  /**/ //some code
  */ /***/ //somecode
  </code></pre>
  
  <p>So basically if there is a line of code outside a comment it is valid, otherwise not.</p>
  
  <p>What would be the best way to tackle this kind of validation?</p>
  
  <p>Note:<br>
  For     <code>*/</code> I assume that the <code>/*</code> has been opened some lines before.</p>