I want generate below code using javapoet
Javapoet is a library to autogenerate java code.
@SuppressWarnings("unchecked")
public static <T> T[] returnArrayForType(T value) {
Object array = Array.newInstance(value.getClass(), 1);
Array.set(array, 0, value);
return (T[]) array;
}
I know how to write for defined types, but how should i deal with it? Can anyone help?