### Question:
Collection extends Rule<Collection> implements Serializable { public static String encodeStr(String string) { Pattern p = Pattern.compile("[^A-Za-z0-9\\-\\.\\_\\(\\)\\'\\!\\:\\,\\;\\*]"); Matcher m = p.matcher(string); StringBuffer sb = new StringBuffer(); while (m.find()) { String chars = m.group(); StringBuilder hex = new StringBuilder("@").append(Hex.encodeHex(chars.getBytes())); while (hex.length() < 5) hex.insert(1, "0"); m.appendReplacement(sb, hex.toString()); } m.appendTail(sb); return sb.toString(); } Collection();  Collection(String defaultName); static String encodeResourceKey(Map values, Index index); static String encodeResourceKey(List pieces); static void main(String[] args); static String encodeStr(String string); static String decodeStr(String string); boolean isLinkTbl(); Property getProperty(String jsonOrColumnName); Property findProperty(String jsonOrColumnName); Property getPropertyByJsonName(String jsonName); Property getPropertyByColumnName(String columnName); String getColumnName(String jsonName); boolean equals(Object object); Db getDb(); Collection withDb(Db db); String getTableName(); Collection withTableName(String name); @Override String getName(); List<Property> getProperties(); Collection withProperties(Property... props); Collection withProperty(String name, String type); Collection withProperty(String name, String type, boolean nullable); void removeProperty(Property prop); Index getPrimaryIndex(); Index getIndex(String indexName); ArrayList<Index> getIndexes(); Collection withIndexes(Index... indexes); Collection withIndex(String name, String type, boolean unique, String... propertyNames); void removeIndex(Index index); boolean isExclude(); Collection withExclude(boolean exclude); Relationship getRelationship(String name); List<Relationship> getRelationships(); void removeRelationship(Relationship relationship); Collection withRelationships(Relationship... relationships); Collection withRelationship(Relationship relationship); Collection withManyToOneRelationship(Collection parentCollection, String childPropertyName, String... childFkProps); Collection withManyToOneRelationship(Collection parentCollection, String childPropertyName, Property... childFkProps); Collection withOneToManyRelationship(String parentPropertyName, Collection childCollection, String childPropertyName, String... childFkProps); Collection withOneToManyRelationship(String parentPropertyName, Collection childCollection, String childPropertyName, Property... childFkProps); boolean hasName(String nameOrAlias); Set<String> getAliases(); Collection withAliases(String... aliases); String encodeResourceKey(Map<String, Object> values); Row decodeResourceKey(String inKey); Rows decodeResourceKeys(String inKeys); Row decodeResourceKey(Index index, String inKey); Rows decodeResourceKeys(Index index, String inKeys); Collection copy();  }### Answer:
@Test public void encodeStr_dontEncodeAlwaysSafeUrlCharsOtherThanTildeAndAmpersand() throws Exception { String source = "asdf1234-._()'!*:,;"; String encoded = Collection.encodeStr(source); System.out.println(encoded); source = "asdf1234---~@%<>[]{}|\\^?/#+&= ---5678910"; encoded = Collection.encodeStr(source); System.out.println(encoded); }