public static final boolean cyclicEqual(int[] arr, int[] brr) {
		final int len = arr.length;
		if (len != brr.length) return false;
		if (len == 0) return true;
		if (len == 1) return arr[0] == brr[0];
		
		int bstart;
		int bincr;
		for (bstart = 0; bstart < len; ++bstart) if (brr[bstart] == arr[0]) break;
		if (bstart >= len) return false;
		bincr = (brr[(bstart + 1) % len] == arr[1] ? 1 : -1);
		
		for (int i = 0; i < len; bstart = (bstart + bincr + len) % len, ++i) {
			if (arr[i] != brr[bstart]) return false;
		}
		return true;
	}