@Override
  public Iterable<T> get() {
    return values;
  }
@Test
  public void testGetCached() throws Exception {
    FakeBeamFnStateClient fakeBeamFnStateClient =
        new FakeBeamFnStateClient(
            StringUtf8Coder.of(),
            ImmutableMap.of(key(), asList("A1", "A2", "A3", "A4", "A5", "A6")));

    Cache<?, ?> cache = Caches.eternal();
    {
      // The first side input will populate the cache.
      IterableSideInput<String> iterableSideInput =
          new IterableSideInput<>(
              cache, fakeBeamFnStateClient, "instructionId", key(), StringUtf8Coder.of());
      assertArrayEquals(
          new String[] {"A1", "A2", "A3", "A4", "A5", "A6"},
          Iterables.toArray(iterableSideInput.get(), String.class));
    }

    {
      // The next side input will load all of its contents from the cache.
      IterableSideInput<String> iterableSideInput =
          new IterableSideInput<>(
              cache,
              requestBuilder -> {
                throw new IllegalStateException("Unexpected call for test.");
              },
              "instructionId",
              key(),
              StringUtf8Coder.of());
      assertArrayEquals(
          new String[] {"A1", "A2", "A3", "A4", "A5", "A6"},
          Iterables.toArray(iterableSideInput.get(), String.class));
    }
  }