转换 Collection 所有元素（通过 toString()）为 String，每个元素的前面加入 prefix，后面加入
postfix，如<div>mymessage</div>。

@param collection
来源集合
@param prefix
前缀
@param postfix
后缀
@return 组合字符串
355702
public static String convertToString(final Collection collection, final String prefix, final String postfix) {
		StringBuilder builder = new StringBuilder();
		for (Object o : collection) {
			builder.append(prefix).append(o).append(postfix);
		}
		return builder.toString();
	}
409823
private <T> void setCached(String prefix, String postfix, T data) {
    cache.put(prefix + '.' + postfix, data);
  }
341666
protected synchronized void addPrefix(final String prefixString) {
		if (prefixString != null) {
			final Set<String> prefixes = getPrefixes();
			prefixes.add(prefixString);
			setPrefixes(prefixes);
		}
	}
1072621
public static <T, J extends Convertable<T>> ArrayList<T> convert(Collection<J> collection) {
        if (collection == null) {
            return null;
        }

        ArrayList<T> list = new ArrayList<>(collection.size());

        for (J json : collection) {
            try {
                T item = json == null ? null : json.convert();
                if (item != null) {
                    list.add(item);
                }
            } catch (ParseException e) {
                Log.e("ConvertUtils", "Error converting item (" + json.getClass().getSimpleName()
                        + ") : " + e.getMessage());
            }
        }

        return list;
    }
840260
public Pattern updatePattern(final Collection<String> prefixes) {
        final String XML_PREFIX = prefixes.stream()
                .map(s -> Pattern.quote(s + "/"))
                .collect(Collectors.joining("|"));

        return XML_PATH_PATTERN = Pattern.compile("^/?(?:" + XML_PREFIX + ")?(?:" + IDX_PREFIX + ")?(?<fieldPath>[^/]+(?:/[^/]+)*)$");
    }
111606
public <T extends Collection<?>> T notEmpty(final T collection, final String message) {
        if (collection == null) {
            failNull(message);
        }
        if (collection.isEmpty()) {
            fail(message);
        }
        return collection;
    }
490982
protected function optional(string $prefix, string $expression, string $postfix = ''): string
    {
        if (empty($expression)) {
            return '';
        }

        if ($prefix != "\n" && $prefix != ' ') {
            $prefix .= ' ';
        }

        return $prefix . $expression . $postfix;
    }
646070
public function postfix(string $value, string $postfix): string
    {
        if (substr($value, strlen($value) - strlen($postfix)) === $postfix) {
            return $value;
        }

        return $value . $postfix;
    }
1170998
public List<String> prefixMatch(String prefix)
    {
        int curState = 1;
        IntArrayList bytes = new IntArrayList(prefix.length() * 4);
        for (int i = 0; i < prefix.length(); i++)
        {
            int codePoint = prefix.charAt(i);
            if (curState < 1)
            {
                return Collections.emptyList();
            }
            if ((curState != 1) && (isEmpty(curState)))
            {
                return Collections.emptyList();
            }
            int[] ids = this.charMap.toIdList(codePoint);
            if (ids.length == 0)
            {
                return Collections.emptyList();
            }
            for (int j = 0; j < ids.length; j++)
            {
                int c = ids[j];
                if ((getBase(curState) + c < getBaseArraySize())
                    && (getCheck(getBase(curState) + c) == curState))
                {
                    bytes.append(c);
                    curState = getBase(curState) + c;
                }
                else
                {
                    return Collections.emptyList();
                }
            }

        }
        List<String> result = new ArrayList<String>();
        recursiveAddSubTree(curState, result, bytes);

        return result;
    }
842248
private static int postfixLen(String o1, String o2, int prefix) {
    int postfix = 0;
    int p1 = o1.length(), p2 = o2.length();
    while(p1 > prefix && p2 > prefix && (o1.charAt(--p1) == o2.charAt(--p2))) {
      ++postfix;
    }
    return postfix;
  }
968071
private static void collectPrefixes(FieldInfos fieldInfos, String field,
      ComponentField fieldInfo, Status status) throws IOException {
    if (fieldInfo.prefix != null) {
      FieldInfo fi = fieldInfos.fieldInfo(field);
      if (fi != null) {
        String singlePositionPrefixes = fi.getAttribute(
            MtasCodecPostingsFormat.MTAS_FIELDINFO_ATTRIBUTE_PREFIX_SINGLE_POSITION);
        String multiplePositionPrefixes = fi.getAttribute(
            MtasCodecPostingsFormat.MTAS_FIELDINFO_ATTRIBUTE_PREFIX_MULTIPLE_POSITION);
        String setPositionPrefixes = fi.getAttribute(
            MtasCodecPostingsFormat.MTAS_FIELDINFO_ATTRIBUTE_PREFIX_SET_POSITION);
        String intersectingPrefixes = fi.getAttribute(
            MtasCodecPostingsFormat.MTAS_FIELDINFO_ATTRIBUTE_PREFIX_INTERSECTION);
        if (singlePositionPrefixes != null) {
          String[] prefixes = singlePositionPrefixes
              .split(Pattern.quote(MtasToken.DELIMITER));
          for (int i = 0; i < prefixes.length; i++) {
            fieldInfo.prefix.addSinglePosition(prefixes[i]);
          }
        }
        if (multiplePositionPrefixes != null) {
          String[] prefixes = multiplePositionPrefixes
              .split(Pattern.quote(MtasToken.DELIMITER));
          for (int i = 0; i < prefixes.length; i++) {
            fieldInfo.prefix.addMultiplePosition(prefixes[i]);
          }
        }
        if (setPositionPrefixes != null) {
          String[] prefixes = setPositionPrefixes
              .split(Pattern.quote(MtasToken.DELIMITER));
          for (int i = 0; i < prefixes.length; i++) {
            fieldInfo.prefix.addSetPosition(prefixes[i]);
          }
        }
        if (intersectingPrefixes != null) {
          String[] prefixes = intersectingPrefixes
              .split(Pattern.quote(MtasToken.DELIMITER));
          for (int i = 0; i < prefixes.length; i++) {
            fieldInfo.prefix.addIntersecting(prefixes[i]);
          }
        }
      }
    }
  }
933473
@Override
	public boolean contains(String prefix) {
		Set<String> prefixes = prefixToURIMap.keySet();
		return prefixes.contains(prefix);
	}
1137433
@Override
    public String format(OperationRequestAddress prefix) {

        Iterator<Node> iterator = prefix.iterator();
        if(!iterator.hasNext()) {
            return "/";
        }

        StringBuilder builder = new StringBuilder();
        builder.append('/');
        Node next = iterator.next();
        builder.append(next.getType());
        if(next.getName() != null) {
            builder.append('=').append(next.getName());
        }
        while(iterator.hasNext()) {
            builder.append('/');
            next = iterator.next();
            builder.append(next.getType());
            if(next.getName() != null) {
                builder.append('=').append(next.getName());
            }
        }
        return builder.toString();
    }
1039352
public static <T> String join(Collection<T> collection, String delimiter) {
		StringBuilder sb = new StringBuilder();
		join(collection, delimiter, sb);
		return sb.toString();
	}
1262765
@SuppressWarnings({ "unchecked", "rawtypes" })
	public static <T> Collection<T> addAll(Collection<T> collection, Object value, Type elementType) {
		if (null == collection || null == value) {
			return collection;
		}
		if (TypeUtil.isUnknow(elementType)) {
			// 元素类型为空时，使用Object类型来接纳所有类型
			elementType = Object.class;
		} else {
			final Class<?> elementRowType = TypeUtil.getClass(elementType);
			if (null != elementRowType && (elementRowType.isInstance(value) && false == Iterable.class.isAssignableFrom(elementRowType))) {
				// 其它类型按照单一元素处理
				collection.add((T) value);
				return collection;
			}
		}

		Iterator iter;
		if (value instanceof Iterator) {
			iter = (Iterator) value;
		} else if (value instanceof Iterable) {
			iter = ((Iterable) value).iterator();
		} else if (value instanceof Enumeration) {
			iter = new EnumerationIter<>((Enumeration) value);
		} else if (ArrayUtil.isArray(value)) {
			iter = new ArrayIter<>(value);
		} else if (value instanceof CharSequence) {
			// String按照逗号分隔的列表对待
			iter = StrUtil.splitTrim((CharSequence) value, CharUtil.COMMA).iterator();
		} else {
			// 其它类型按照单一元素处理
			iter = CollUtil.newArrayList(value).iterator();
		}

		final ConverterRegistry convert = ConverterRegistry.getInstance();
		while (iter.hasNext()) {
			collection.add((T) convert.convert(elementType, iter.next()));
		}

		return collection;
	}
227374
public Reader getFile(String prefix, String postfix)
      throws MtasParserException {
    String file = getString();
    if ((file != null) && !file.equals("")) {
      if (prefix != null) {
        file = prefix + file;
      }
      if (postfix != null) {
        file = file + postfix;
      }
      Path path = (new File(file)).toPath();
      if(Files.isReadable(path)) {
        try {
          return new InputStreamReader(new GZIPInputStream(new FileInputStream(file)), StandardCharsets.UTF_8);
        } catch (IOException e1) {
          log.debug(e1);
          try {
            String text = new String(Files.readAllBytes(Paths.get(file)),
                StandardCharsets.UTF_8);
            return new StringReader(text);
          } catch (IOException e2) {
            log.debug(e2);
            throw new MtasParserException(e2.getMessage());
          }
        } 
      } else {
        throw new MtasParserException("file '"+file+"' does not exists or not readable");
      }
    } else {
      throw new MtasParserException("no valid file: " + file);
    }
  }
952063
String prefix(String s) {
         return prefix(s, feedback.getPre(), feedback.getPost());
    }