### Question:
ApplicationLayout extends VerticalLayout implements ViewDisplay { protected <T extends View & Component> T getCurrentView() { @SuppressWarnings("unchecked") T view = (T)mainArea; return view; } ApplicationLayout(ApplicationHeader header, @CheckForNull ApplicationFooter footer); @Override void showView(View view);  }### Answer:
@Test public void testGetCurrentView_empty() { setUpApplicationLayout(); Component currentView = applicationLayout.getCurrentView(); assertThat(currentView, is(instanceOf(EmptyView.class))); }
@Test public void testGetCurrentView() { setUpApplicationLayout(); View view = mock(View.class, withSettings().extraInterfaces(Component.class).defaultAnswer(Mockito.CALLS_REAL_METHODS)); applicationLayout.showView(view); Component currentView = applicationLayout.getCurrentView(); assertThat(currentView, is(view)); }
@Test public void testGetCurrentView() { setUpApplicationLayout(); View view = mock(View.class, withSettings().extraInterfaces(Component.class)); applicationLayout.showView(view); Component currentView = applicationLayout.getCurrentView(); assertThat(currentView, is(view)); }