public static <K, InputT, AccumT, OutputT> CombineFn<InputT, AccumT, OutputT> bindContext(
      CombineFnWithContext<InputT, AccumT, OutputT> combineFn, StateContext<?> stateContext) {
    Context context = CombineContextFactory.createFromStateContext(stateContext);
    return new NonSerializableBoundedCombineFn<>(combineFn, context);
  }
@Test
  public void testNonSerializable() throws Exception {
    expectedException.expect(NotSerializableException.class);
    expectedException.expectMessage(
        "Cannot serialize the CombineFn resulting from CombineFnUtil.bindContext.");

    ByteArrayOutputStream buffer = new ByteArrayOutputStream();
    ObjectOutputStream oos = new ObjectOutputStream(buffer);
    oos.writeObject(CombineFnUtil.bindContext(mockCombineFn, StateContexts.nullContext()));
  }