### Question:
GithubTemplateResource implements ITemplateResource { @Override public boolean exists() { return StringUtils.isNotBlank(fetchTemplateContents()); } GithubTemplateResource(final String owner, final String repo, final String branch, final String location, final GithubRawClient githubRawClient); @Override String getDescription(); @Override String getBaseName(); @Override boolean exists(); @Override Reader reader(); @Override GithubTemplateResource relative(String relativeLocation);  }### Answer:
@Test void exists() { when(githubRawClient.getContentsAsRaw(owner, repo, branch, location)).thenReturn("fasgzd"); final boolean result = resource.exists(); assertThat(result).isTrue(); }
@Test void exists_contentsEmpty() { when(githubRawClient.getContentsAsRaw(owner, repo, branch, location)).thenReturn(""); final boolean result = resource.exists(); assertThat(result).isFalse(); }
@Test void exists_githubclientException() { doThrow(new RuntimeException()).when(githubRawClient).getContentsAsRaw(owner, repo, branch, location); final boolean result = resource.exists(); assertThat(result).isFalse(); }