public static String leadingTrailing(String text, String leadingTrailing, int leading, int trailing) {
		if (leading <= 0 || trailing <= 0 || leadingTrailing == null) {
			return text;
		}

		int size = leading + trailing + (text != null ? text.length() : 0);

		if (size < 0) {
			//Integer value overflow
			size = leading > trailing ? leading : trailing;
		}

		StringBuilder sb = new StringBuilder(size);

		for (int i = 0; i < leading; i++) {
			sb.append(leadingTrailing);
		}

		sb.append(text);

		for (int i = 0; i < trailing; i++) {
			sb.append(leadingTrailing);
		}

		return sb.toString();
	}