### Question:
TrimouTemplateAvailabilityProvider implements TemplateAvailabilityProvider { public boolean isTemplateAvailable(final String view, final Environment environment, final ClassLoader classLoader, final ResourceLoader resourceLoader) { if (ClassUtils.isPresent("org.trimou.Mustache", classLoader)) { final PropertyResolver resolver = new RelaxedPropertyResolver(environment, TrimouProperties.PROPERTY_PREFIX + '.'); final String prefix = resolver.getProperty("prefix", SpringResourceTemplateLocator.DEFAULT_PREFIX); final String suffix = resolver.getProperty("suffix", SpringResourceTemplateLocator.DEFAULT_SUFFIX); final String resourceLocation = prefix + view + suffix; return resourceLoader.getResource(resourceLocation).exists(); } return false; }  boolean isTemplateAvailable(final String view, final Environment environment, final ClassLoader classLoader,
            final ResourceLoader resourceLoader);  }### Answer:
@Test public void availabilityOfTemplateInDefaultLocation() throws Exception { assertThat(provider.isTemplateAvailable("home", environment, getClass().getClassLoader(), resourceLoader), is(true)); assertThat(provider.isTemplateAvailable("prefix/prefixed", environment, getClass().getClassLoader(), resourceLoader), is(true)); }
@Test public void availabilityOfTemplateThatDoesNotExist() throws Exception { assertThat(provider.isTemplateAvailable("unknown", environment, getClass().getClassLoader(), resourceLoader), is(false)); }
@Test public void availabilityOfTemplateWithCustomPrefix() throws Exception { environment.setProperty("trimou.prefix", "classpath:/custom-templates/"); assertThat(provider.isTemplateAvailable("custom", environment, getClass().getClassLoader(), resourceLoader), is(true)); }
@Test public void availabilityOfTemplateWithCustomSuffix() throws Exception { environment.setProperty("trimou.suffix", ".html"); assertThat(provider.isTemplateAvailable("suffixed", environment, getClass().getClassLoader(), resourceLoader), is(true)); }