title: How to test menu in Android with Robolectric
body: <p>I need to write tests to menu in Android application using Robolectric.</p>
  
  <p>Source code of menu:</p>
  
  <pre><code>@Override
  public boolean onCreateOptionsMenu(Menu menu) {
      getMenuInflater().inflate(R.menu.main, menu);
      return super.onCreateOptionsMenu(menu);
  }
  
  @Override
  public boolean onMenuItemSelected(int featureId, MenuItem item) {
      switch (item.getItemId()) {
      case R.id.exit:
          this.finish();
          break;
      default:
          Toast.makeText(this, getString(R.string.errMsg), Toast.LENGTH_SHORT).show();
          break;
      }
      return super.onMenuItemSelected(featureId, item);
  } 
  </code></pre>
  
  <p>Please help to write tests</p>