ConstantBitrateSeekMap implements SeekMap { public long getTimeUsAtPosition(long position) { return getTimeUsAtPosition(position, firstFrameBytePosition, bitrate); } ConstantBitrateSeekMap(
      long inputLength, long firstFrameBytePosition, int bitrate, int frameSize); @Override boolean isSeekable(); @Override SeekPoints getSeekPoints(long timeUs); @Override long getDurationUs(); long getTimeUsAtPosition(long position);  }
@Test public void testGetTimeUsAtPosition_forPosition0_return0() { constantBitrateSeekMap = new ConstantBitrateSeekMap( 2_300, 100, 8_000, 100); long timeUs = constantBitrateSeekMap.getTimeUsAtPosition(0); assertThat(timeUs).isEqualTo(0); }
@Test public void testGetTimeUsAtPosition_forPositionWithinStream_returnCorrectTime() { constantBitrateSeekMap = new ConstantBitrateSeekMap( 2_300, 100, 8_000, 100); long timeUs = constantBitrateSeekMap.getTimeUsAtPosition(1234); assertThat(timeUs).isEqualTo(1_134_000); }