public static long getDataCenterId(long maxDatacenterId) {
		Assert.isTrue(maxDatacenterId > 0, "maxDatacenterId must be > 0");
		if(maxDatacenterId == Long.MAX_VALUE){
			maxDatacenterId -= 1;
		}
		long id = 1L;
		byte[] mac = null;
		try{
			mac = NetUtil.getLocalHardwareAddress();
		}catch (UtilException ignore){
			// ignore
		}
		if (null != mac) {
			id = ((0x000000FF & (long) mac[mac.length - 2])
					| (0x0000FF00 & (((long) mac[mac.length - 1]) << 8))) >> 6;
			id = id % (maxDatacenterId + 1);
		}

		return id;
	}
@Test
	public void getDataCenterIdTest(){
		//按照mac地址算法拼接的算法，maxDatacenterId应该是0xffffffffL>>6-1此处暂时按照0x7fffffffffffffffL-1，防止最后取模溢出
		final long dataCenterId = IdUtil.getDataCenterId(Long.MAX_VALUE);
		assertTrue(dataCenterId >= 0);
	}