### Question:
PropertyUtil { public static URI eraseQuery(URI uri) throws URISyntaxException { return replaceQuery(uri, (String) null); }  static URI replaceQuery(URI originalURI, Map<String, String> properties); static URI replaceQuery(URI uri, String query); static URI eraseQuery(URI uri); static String createQueryString(Map<String, ? extends Object> options); static Map<String, String> parseQuery(URI uri); static Map<String, String> parseQuery(String queryString); static Map<String, String> filterProperties(Map<String, String> properties, String optionPrefix); static Map<String, String> setProperties(Object target, Map<String, String> properties); static Map<String, Object> setProperties(Object target, Properties properties); static Map<String, String> getProperties(Object object); static Object getProperty(Object object, String name); static boolean setProperty(Object target, String name, Object value); static String stripPrefix(String value, String prefix); static String stripUpto(String value, char c); static String stripBefore(String value, char c);  }### Answer:
@Test public void testEraseQuery() throws URISyntaxException { URI original = new URI("http: URI updated = PropertyUtil.eraseQuery(original); assertNull(updated.getQuery()); }
@Test public void testEraseQueryPreservesFragment() throws URISyntaxException { URI original = new URI("http: URI updated = PropertyUtil.eraseQuery(original); assertNull(updated.getQuery()); assertEquals("fragment", updated.getFragment()); }
@Test public void testEraseQueryPreservesFragmentWhenNoQueryPresent() throws URISyntaxException { URI original = new URI("http: URI updated = PropertyUtil.eraseQuery(original); assertNull(updated.getQuery()); assertEquals("fragment", updated.getFragment()); }
@Test public void testEraseQueryIgnoresQueryInCompositeURI() throws URISyntaxException { URI original = new URI("failover:(amqp: URI expected = new URI("failover:(amqp: URI updated = PropertyUtil.eraseQuery(original); assertEquals(expected, updated); }
@Test public void testEraseQueryIgnoresQueryAndFragmentInCompositeURI() throws URISyntaxException { URI original = new URI("failover:(amqp: URI expected = new URI("failover:(amqp: URI updated = PropertyUtil.eraseQuery(original); assertEquals(expected, updated); }