### Question:
Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } Registry(); boolean isInRegistry(String url);  }### Answer:
@Test public void inRegistry_Yes_PartialMatch() throws Exception { FakeRegistry.setRegistry(new HashSet<>(asList( "/path3/path4", "/path1/path2" ))); boolean result = testee.isInRegistry("http: assertTrue(result); }
@Test public void inRegistry_Yes_PathParameters() throws Exception { FakeRegistry.setRegistry(new HashSet<>(asList( "/path3/{parameterA}/{parameterB}", "/path1/path2" ))); boolean result = testee.isInRegistry("http: assertTrue(result); }
@Test public void inRegistry_Yes_QueryParameters() throws Exception { FakeRegistry.setRegistry(new HashSet<>(asList( "/path3/path4", "/path1/path2" ))); boolean result = testee.isInRegistry("http: assertTrue(result); }
@Test public void inRegistry_No() throws Exception { FakeRegistry.setRegistry(new HashSet<>(asList( "/path3/path4", "/path1/path2" ))); boolean result = testee.isInRegistry("http: assertFalse(result); }
@Test public void inRegistry_Yes_PartialMatch() throws Exception { MocksRegistry.setRegistry(new HashSet<>(asList( "/path3/path4", "/path1/path2" ))); boolean result = testee.isInRegistry("http: assertTrue(result); }
@Test public void inRegistry_Yes_PathParameters() throws Exception { MocksRegistry.setRegistry(new HashSet<>(asList( "/path3/{parameterA}/{parameterB}", "/path1/path2" ))); boolean result = testee.isInRegistry("http: assertTrue(result); }
@Test public void inRegistry_Yes_QueryParameters() throws Exception { MocksRegistry.setRegistry(new HashSet<>(asList( "/path3/path4", "/path1/path2" ))); boolean result = testee.isInRegistry("http: assertTrue(result); }
@Test public void inRegistry_No() throws Exception { MocksRegistry.setRegistry(new HashSet<>(asList( "/path3/path4", "/path1/path2" ))); boolean result = testee.isInRegistry("http: assertFalse(result); }