public List<Shard> listShardsFollowingClosedShard(
      final String streamName, final String exclusiveStartShardId)
      throws TransientKinesisException {
    ShardFilter shardFilter =
        ShardFilter.builder()
            .type(ShardFilterType.AFTER_SHARD_ID)
            .shardId(exclusiveStartShardId)
            .build();
    return wrapExceptions(
        () -> ShardListingUtils.listShards(kinesis.get(), streamName, shardFilter));
  }
@Test
  public void shouldListAllShardsForExclusiveStartShardId() throws Exception {
    Shard shard1 = Shard.builder().shardId(SHARD_1).build();
    Shard shard2 = Shard.builder().shardId(SHARD_2).build();
    Shard shard3 = Shard.builder().shardId(SHARD_3).build();

    String exclusiveStartShardId = "exclusiveStartShardId";

    when(kinesis.listShards(
            ListShardsRequest.builder()
                .streamName(STREAM)
                .maxResults(1_000)
                .shardFilter(
                    ShardFilter.builder()
                        .type(ShardFilterType.AFTER_SHARD_ID)
                        .shardId(exclusiveStartShardId)
                        .build())
                .build()))
        .thenReturn(
            ListShardsResponse.builder().shards(shard1, shard2, shard3).nextToken(null).build());

    List<Shard> shards = underTest.listShardsFollowingClosedShard(STREAM, exclusiveStartShardId);

    assertThat(shards).containsOnly(shard1, shard2, shard3);
  }