title: Correct use Java "assert" keyword
body: <p>I have never understood what is <code>assert</code> used for, even though I have read plenty examples, they don't really let me know what or why should I use it for.</p>
  
  <p>So Instead of asking an example, I'm gonna provide one and let me know if this is the proper usage of <code>assert</code>.</p>
  
  <pre><code>// The idea is that the `mode` variable should be 0 or 1, and no other number.
  switch(mode) {
       case 0: 
            // do stuff
            break;
       case 1:
            // do other stuff
            break;
  
       default:
            // assert code?
  }
  </code></pre>
  
  <p>If this is correct, please let me know how to use it in this case. If this is not how it is supposed to use, please provide an example.</p>