URLPatternMapperFactory { public static <T> URLPatternMapper<T> create(Map<String, T> values) { if (values.size() > 64) { return new DynamicSizeTrieURLPatternMapper<>(values); } return new StaticSizeTrieURLPatternMapper<>(values); }  static URLPatternMapper<T> create(Map<String, T> values);  }
@Test public void testCreate() { Map<String, String> map = new HashMap<>(); for (int i = 0; i < 64; i++) { map.put("*.key" + i, "value" + i); } Assert.assertTrue( URLPatternMapperFactory.create(map) instanceof StaticSizeTrieURLPatternMapper<?>); map.put("*.key" + 64, "value" + 64); Assert.assertTrue( URLPatternMapperFactory.create(map) instanceof DynamicSizeTrieURLPatternMapper<?>); }