public static Integer[] generateBySet(int begin, int end, int size) {
		if (begin > end) {
			int temp = begin;
			begin = end;
			end = temp;
		}
		// 加入逻辑判断，确保begin<end并且size不能大于该表示范围
		if ((end - begin) < size) {
			throw new UtilException("Size is larger than range between begin and end!");
		}

		Set<Integer> set = new HashSet<>(size, 1);
		while (set.size() < size) {
			set.add(begin + RandomUtil.randomInt(end - begin));
		}

		return set.toArray(new Integer[0]);
	}
@Test
	public void generateBySetTest(){
		final Integer[] integers = NumberUtil.generateBySet(10, 100, 5);
		assertEquals(5, integers.length);
	}