@@ -0,0 +1,549 @@
+package io.deepreader.java.commons.util.generics;%0A%0A/**%0A * Created by Daniel on 10/08/15.%0A */%0Ainterface GenericCreation%3CT%3E %7B%0A    default T%5B%5D createGenericArray(int n) %7B%0A        return (T%5B%5D) new Object%5Bn%5D;%0A    %7D%0A%0A    /**%0A     * T.class returns Object.class due to erasure%0A     * @param cls%0A     * @return an instance of T%0A     * @throws IllegalAccessException%0A     * @throws InstantiationException%0A     */%0A    default T newGenericInstance(Class%3CT%3E cls) throws IllegalAccessException, InstantiationException %7B%0A        return cls.newInstance();%0A    %7D%0A%7D%0A

create instance from generic type