### Question:
RecipeHelper { public static Object convert(Type expectedType, Object value, boolean lazyRefAllowed, PropertyEditorRegistry registry) { if (value instanceof Recipe) { Recipe recipe = (Recipe) value; value = recipe.create(expectedType, lazyRefAllowed); } if (char[].class == expectedType && String.class.isInstance(value)) { return String.class.cast(value).toCharArray(); } if (String.class == expectedType && char[].class.isInstance(value)) { return new String(char[].class.cast(value)); } if (value instanceof String && (expectedType != Object.class)) { String stringValue = (String) value; value = (registry == null ? PropertyEditors.registry() : registry).getValue(expectedType, stringValue); } return value; } private  RecipeHelper(); static Recipe getCaller(); static Class loadClass(String name); static boolean hasDefaultConstructor(Class type); static boolean isSimpleType(Object o); static List<Map.Entry<K,V>> prioritizeProperties(Map<K,V> properties); static boolean isInstance(Type t, Object instance); static boolean isConvertable(Type type, Object propertyValue, PropertyEditorRegistry registry); static boolean isAssignableFrom(Class expected, Class actual); static Object convert(Type expectedType, Object value, boolean lazyRefAllowed, PropertyEditorRegistry registry); static boolean isAssignableFrom(List<? extends Class<?>> expectedTypes, List<? extends Class<?>> actualTypes); static boolean isAssignable(Type expectedType, Type actualType); static Class toClass(Type type); static Type[] getTypeParameters(Class desiredType, Type type);  }### Answer:
@Test public void stringCharArrayConvert() { assertArrayEquals("foo".toCharArray(), char[].class.cast(RecipeHelper.convert(char[].class, "foo", false, PropertyEditors.registry()))); assertEquals("foo", RecipeHelper.convert(String.class, "foo".toCharArray(), false, PropertyEditors.registry())); }