title: Return Boolean if element exists
body: <p>I need to implement in Espresso something like this:</p>
  
  <pre><code>if (!onView(withId(R.id.someID)).check(Exist()){
  // push button
  } else {
   // select check box
  }
  </code></pre>
  
  <p>I have checked this post: <a href="https://stackoverflow.com/questions/20807131/espresso-return-boolean-if-view-exists/20811193#20811193">Espresso: return boolean if view exists</a> and would like example how to implement second answer form ValeraZakharov, because I've tried to implement myself but with little success.</p>