public static long[] getPath(long startStream, long targetStream) {
		if (startStream <= 0) {
			throw new IllegalArgumentException("startStream must not be <= 0.");
		}

		if (targetStream <= 0) {
			throw new IllegalArgumentException("targetStream must not be <= 0.");
		}

		String start = Long.toBinaryString(startStream);
		String target = Long.toBinaryString(targetStream);
		int prefix = 0;

		for (int i = 0; i < start.length() && i < target.length(); i++) {
			if (start.charAt(i) == target.charAt(i)) {
				prefix++;
			} else {
				break;
			}
		}

		start = start.substring(prefix);
		target = target.substring(prefix);

		long[] path = new long[start.length() + target.length() + 1];
		path[0] = startStream;
		int index = 1;

		for (int i = 0; i < start.length(); i++) {
			path[index] = path[index - 1] / 2;
			index++;
		}

		for (char c : target.toCharArray()) {
			if (c == '1') {
				path[index] = (path[index - 1] << 1) + 1;
			} else {
				path[index] = path[index - 1] << 1;
			}

			index++;
		}

		return path;
	}