private @NotNull Optional<Long> getBuildTargetHash(@NotNull BuildTarget<?> target, @NotNull CompileContext context) {
    long[] longs = Stream.concat(target.getOutputRoots(context).stream().map(it -> compilationOutputHash(it, target)),
                                 myBuildRootIndex.getTargetRoots(target, context).stream().map(it -> sourceRootHash(it, target)))
      .filter(it -> it != null && !it.isEmpty())
      .flatMap(List::stream)
      .mapToLong(x -> x)
      .toArray();
    if (longs.length == 0) return Optional.empty();
    return Optional.of(Xxh3HashingService.hashLongs(longs));
  }
private @NotNull Optional<Long> getBuildTargetHash(@NotNull BuildTarget<?> target, @NotNull CompileContext context)