@Test
public void shouldDecodeUsingTypeWhenProvided() {

    // given
    String valueToDecode = "value";
    Type<?> anyType = mock(Type.class);
    when(anyType.decode(valueToDecode)).thenReturn(new ObjectHolder("hello"));
    // when
    Object decoded = type.decode("value", anyType, null);
    // then
    assertThat(decoded).isEqualTo("hello");
}