title: Check if a field has been set in protocol buffer 3
body: <p>I am migrating a java application from protocol buffers 2 to protocol buffer 3.</p>
  
  <p>In proto 2 to check if a field is set you have <code>hasfield()</code> method 
  for which an example Java code generated is:</p>
  
  <pre><code>public boolean hasText() {
    return ((bitField0_ &amp; 0x00000004) == 0x00000004);
  }
  </code></pre>
  
  <p>However in proto 3 there it has been removed. 
  How do you check if a field has been set in proto 3?</p>