@Override
  public boolean onOptionsItemSelected(@NonNull MenuItem item) {
    MainSettingsActivity mainSettingsActivity = (MainSettingsActivity) getActivity();
    if (mainSettingsActivity == null) return super.onOptionsItemSelected(item);
    if (item.getItemId() == R.id.add_user_word) {
      createEmptyItemForAdd();
      return true;
    }
    return super.onOptionsItemSelected(item);
  }
@Test
  public void testAddNewWordFromMenuAtEmptyState() {
    UserDictionaryEditorFragment fragment = startEditorFragment();

    RecyclerView wordsRecyclerView = fragment.getView().findViewById(R.id.words_recycler_view);
    Assert.assertNotNull(wordsRecyclerView);
    Assert.assertEquals(1 /*empty view*/, wordsRecyclerView.getAdapter().getItemCount());
    Assert.assertEquals(
        R.id.word_editor_view_type_empty_view_row,
        wordsRecyclerView.getAdapter().getItemViewType(0));

    final MenuItem menuItem = Mockito.mock(MenuItem.class);
    Mockito.doReturn(R.id.add_user_word).when(menuItem).getItemId();
    fragment.onOptionsItemSelected(menuItem);
    TestRxSchedulers.drainAllTasks();

    Assert.assertEquals(1, wordsRecyclerView.getAdapter().getItemCount());
    Assert.assertEquals(
        R.id.word_editor_view_type_editing_row, wordsRecyclerView.getAdapter().getItemViewType(0));
  }