### Question:
HomepageForwardingMatcher implements Predicate<T> { public boolean test(T request) { if (!HttpMethod.GET.matches(this.methodAccessor.apply(request))) { return false; } String path = this.pathAccessor.apply(request); if (this.excludeRoutes.stream().anyMatch((p) -> p.matcher(path).matches()) || this.includeRoutes.stream().noneMatch((p) -> p.matcher(path).matches())) { return false; } return this.acceptsAccessor.apply(request).stream().anyMatch((t) -> t.includes(MediaType.TEXT_HTML)); } HomepageForwardingMatcher(List<String> includeRoutes, List<String> excludeRoutes,
			Function<T, String> methodAccessor, Function<T, String> pathAccessor,
			Function<T, List<MediaType>> acceptsAccessor); boolean test(T request);  }### Answer:
@Test public void should_return_false_when_method_is_not_get() { assertThat(this.matcher.test(new MockRequest("POST", "/viewRoute", singletonList(MediaType.TEXT_HTML)))) .isFalse(); }
@Test public void should_return_false_when_path_does_not_match() { assertThat(this.matcher.test(new MockRequest("GET", "/api", singletonList(MediaType.TEXT_HTML)))).isFalse(); }
@Test public void should_return_false_when_accepts_does_not_match() { assertThat(this.matcher.test(new MockRequest("GET", "/viewRoute", singletonList(MediaType.APPLICATION_XML)))) .isFalse(); }
@Test public void should_return_false_when_path_is_excluded() { assertThat(this.matcher .test(new MockRequest("GET", "/viewRoute/12345/exclude", singletonList(MediaType.TEXT_HTML)))) .isFalse(); }
@Test public void should_return_true() { assertThat(this.matcher .test(new MockRequest("GET", "/viewRoute/detail?query", singletonList(MediaType.TEXT_HTML)))).isTrue(); }