title: Comparing a char to a code-point?
body: <p>What is the "correct" way of comparing a code-point to a Java character? For example:</p>
  
  <pre><code>int codepoint = String.codePointAt(0);
  char token = '\n';
  </code></pre>
  
  <p>I know I can probably do:</p>
  
  <pre><code>if (codepoint==(int) token)
  { ... }
  </code></pre>
  
  <p>but this code looks fragile. Is there a formal API method for comparing <code>codepoints</code> to <code>chars</code>, or converting the <code>char</code> up to a <code>codepoint</code> for comparison?</p>