I need to implement in Espresso something like this:
if (!onView(withId(R.id.someID)).check(Exist()){
// push button
} else {
// select check box
}
I have checked this post: Espresso: return boolean if view exists and would like example how to implement second answer form ValeraZakharov, because I've tried to implement myself but with little success.