@Override
  public int getFrameForTimestampMs(int timestampMs) {
    int accumulator = 0;
    for (int i = 0; i < mFrameDurations.length; i++) {
      if (timestampMs < accumulator + mFrameDurations[i]) {
        return i;
      }
      accumulator += mFrameDurations[i];
    }
    return mFrameDurations.length - 1;
  }
Implementation of {@link AnimatedDrawableBackend} for unit tests.
animated-base/src/test/java/com/facebook/imagepipeline/animated/testing/TestAnimatedDrawableBackend.java