public static <FnT extends DoFn<?, ?>> DoFnSignature getSignature(Class<FnT> fn) {
    return signatureCache.computeIfAbsent(fn, DoFnSignatures::parseSignature);
  }
@Test
  public void testStateParameterAlwaysFetchNonReadableState() {
    thrown.expect(IllegalArgumentException.class);
    thrown.expectMessage("ReadableStates");
    DoFnSignatures.getSignature(
        new DoFn<KV<String, Integer>, Long>() {

          @StateId("my-id")
          private final StateSpec<MapState<Integer, Integer>> myfield =
              StateSpecs.map(VarIntCoder.of(), VarIntCoder.of());

          @ProcessElement
          public void myProcessElement(
              ProcessContext context,
              @AlwaysFetched @StateId("my-id") MapState<Integer, Integer> one) {}
        }.getClass());
  }