public boolean shouldShow(@NonNull PublicNotices ime) {
    final View candidate = ime.getInputViewContainer().getCandidateView();
    return candidate != null && candidate.getVisibility() == View.VISIBLE;
  }
@Test
  @SuppressWarnings("ResultOfMethodCallIgnored")
  public void testHappyPath() {
    CandidateViewShowingHelper helper = new CandidateViewShowingHelper();

    final PublicNotices ime = Mockito.mock(PublicNotices.class);
    final KeyboardViewContainerView container = Mockito.mock(KeyboardViewContainerView.class);
    Mockito.doReturn(container).when(ime).getInputViewContainer();
    Mockito.doReturn(null).when(container).getCandidateView();

    Assert.assertFalse(helper.shouldShow(ime));

    CandidateView candidate = Mockito.mock(CandidateView.class);
    Mockito.doReturn(candidate).when(container).getCandidateView();
    Mockito.doReturn(View.GONE).when(candidate).getVisibility();
    Assert.assertFalse(helper.shouldShow(ime));

    Mockito.doReturn(View.INVISIBLE).when(candidate).getVisibility();
    Assert.assertFalse(helper.shouldShow(ime));

    Mockito.doReturn(View.VISIBLE).when(candidate).getVisibility();
    Assert.assertTrue(helper.shouldShow(ime));
  }