@Test
public void getTypedStateVariableWorks() {

  when(mapper.convertFromObject("key", 42L)).thenReturn("42");
  when(mapper.convertToObject(Long.class, "key", "42")).thenReturn(42L);
  WorkflowInstance instance = new WorkflowInstance.Builder(mapper).putStateVariable("key", 42L).build();
  assertThat(instance.getStateVariable("key", Long.class), is(42L));
}