shadows/framework/src/main/java/org/robolectric/shadows/ShadowMediaMuxer.java
@Implementation
  protected static long nativeSetup(@NonNull FileDescriptor fd, int format) throws IOException {
    FileOutputStream outputStream = fdToStream.get(fd);

    long potentialKey;
    do {
      potentialKey = random.nextLong();
    } while (potentialKey == 0 || outputStreams.putIfAbsent(potentialKey, outputStream) != null);

    nextTrackIndices.put(potentialKey, new AtomicInteger(0));
    return potentialKey;
  }
@Implementation
  protected static long nativeSetup(@NonNull FileDescriptor fd, int format) throws IOException {
    FileOutputStream outputStream = fdToStream.get(fd);

    long potentialKey;
    do {
      potentialKey = random.nextLong();
    } while (potentialKey == 0 || outputStreams.putIfAbsent(potentialKey, outputStream) != null);

    nextTrackIndices.put(potentialKey, new AtomicInteger(0));
    return potentialKey;
  }
Generates and returns an internal id to track the FileOutputStream corresponding to individual
MediaMuxer instances.