ValueUtil { public static Object convert(Value value) { Objects.requireNonNull(value, "value is required"); Object val = value.get(); if(val instanceof Iterable) { return getObjects(val); } return getObject(val); } private  ValueUtil(); static Object convert(Value value); static List<Object> convertToList(Value value);  }
@Test public void shouldConvert() { Value value = Value.of(10); assertEquals(10, ValueUtil.convert(value)); }
@Test public void shouldConvert2() { Value value = Value.of(Arrays.asList(10, 20)); assertEquals(Arrays.asList(10, 20), ValueUtil.convert(value)); }
@Test public void shouldConvert3() { Value value = Value.of(Arrays.asList(Value.of(10), Value.of(20))); assertEquals(Arrays.asList(10, 20), ValueUtil.convert(value)); }