### Question:
TemplateUtil { public static boolean hasTemplate(@CheckForNull final Page page, @CheckForNull final String templatePath) { if (page == null) { return false; } return hasTemplate(page.getProperties(), templatePath); } private  TemplateUtil(); static boolean hasTemplate(@CheckForNull final Page page, @CheckForNull final String templatePath);  }### Answer:
@Test public void test_that_null_page_always_returns_false() { assertThat(TemplateUtil.hasTemplate(null, TMPL_FAKE), is(false)); }
@Test public void test_that_null_template_always_returns_false() { Page page = mock(Page.class); ValueMap properties = createTemplateValueMap(TMPL_FAKE); when(page.getProperties()).thenReturn(properties); assertThat(TemplateUtil.hasTemplate(page, null), is(false)); }
@Test public void test_that_null_properties_always_returns_false() { Page page = mock(Page.class); assertThat(TemplateUtil.hasTemplate(page, TMPL_FAKE), is(false)); }
@Test public void test_that_correct_template_returns_true() { Page page = mock(Page.class); ValueMap properties = createTemplateValueMap(TMPL_FAKE); when(page.getProperties()).thenReturn(properties); assertThat(TemplateUtil.hasTemplate(page, TMPL_FAKE), is(true)); }
@Test public void test_that_correct_template_returns_false() { Page page = mock(Page.class); ValueMap properties = createTemplateValueMap(TMPL_FAKE2); when(page.getProperties()).thenReturn(properties); assertThat(TemplateUtil.hasTemplate(page, TMPL_FAKE), is(false)); }