import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Constructor;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.util.Map;
import java.util.Hashtable;
import java.util.List;
import java.util.LinkedList;
import codeassess.javassessment.Assessor;
import codeassess.misc.Misc;

public class Template extends Assessor {

    public Map<String, String> getConfig() {
        final Map<String, String> config = new Hashtable<String, String>();
        config.put("Language", "Java");
        config.put("Extensions", ".java");
        config.put("AssessmentMode", "SemiAutomatic");
        return config;
    }

    public List<Object[]> getProperties() {
        final List<Object[]> properties = new LinkedList<Object[]>();
        properties.add(new Object[] { "Eval1", "Functionality", null, new String[] {  }, "MiPila.java", "Debes implementar la clase Pila", "Perfil clase MiPila", 0.15 });
        properties.add(new Object[] { "Eval2", "Functionality", null, new String[] {  }, "MiPila.java", "Debes declarar un atributo de tipo ArrayList", "Atributo ArrayList", 0.05 });
        properties.add(new Object[] { "Eval3", "Functionality", null, new String[] {  }, "MiPila.java", "Debes declarar un constructor", "Constructor de la clase MiPila", 0.05 });
        properties.add(new Object[] { "Eval4", "Functionality", null, new String[] {  }, "MiPila.java", "Debes implementar el método apilar", "Implementar método apilar", 0.1 });
        properties.add(new Object[] { "Eval5", "Functionality", null, new String[] {  }, "MiPila.java", "Debes implementar el método desapilar", "Implementar método desapilar", 0.15 });
        properties.add(new Object[] { "Eval6", "Functionality", null, new String[] {  }, "MiPila.java", "Debes implementar el método cima", "Implementar método cima", 0.15 });
        properties.add(new Object[] { "Eval7", "Functionality", null, new String[] {  }, "MiPila.java", "Debes implementar el método esVacia", "Implementar método esVacia", 0.1 });
        properties.add(new Object[] { "Eval8", "Functionality", null, new String[] {  }, "MiPila.java", "Debes implementar el método talla", "Implementar método talla", 0.1 });
        properties.add(new Object[] { "Eval9", "Functionality", null, new String[] {  }, "MiPila.java", "Debes implementar el método toString", "Implementar método toString", 0.15 });
        return properties;
    }

    public boolean checkEval1() {
        final Class class1 = super.introspector.getClass("MiPila");
        if (class1 == null) return false;
        if (!(super.introspector.getGenericTypeParameterCount(class1) == 1)) return false;
        if (!(super.introspector.getInterfaceCount(class1) == 1)) return false;
        boolean typeVariable1Checker = false;
        for (TypeVariable typeVariable1 : super.introspector.getGenericTypeParameters(class1)) {
            boolean type1Checker = false;
            for (Type type1 : super.introspector.getInterfacesTypes(class1)) {
                final int[] ints1 = { 0 };
                final TypeVariable typeVariable2 = super.introspector.getGenericType(type1, ints1);
                if (typeVariable2 == null) continue;
                if (!(super.introspector.checkSameGenericTypes(typeVariable1, typeVariable2) == true)) continue;
                type1Checker = true;
                break;
            }
            if (type1Checker == false) continue;
            typeVariable1Checker = true;
            break;
        }
        if (typeVariable1Checker == false) return false;
        return true;
    }

    public boolean solveEval1() {
        final Class class1 = super.introspector.getClass("MiPila");
        if (class1 == null) return false;
        super.intercessor.removeGenericTypeParameters(class1);
        return true;
    }

    public String[] testEval1() {
        return null;
    }

    public boolean checkEval2() {
        final Class class1 = super.introspector.getClass("MiPila");
        if (class1 == null) return false;
        final Class class2 = super.introspector.getClass("java.util.ArrayList");
        if (class2 == null) return false;
        boolean field1Checker = false;
        for (Field field1 : super.introspector.getDeclaredFields(class1)) {
            if (!(super.introspector.checkGenericType(field1, 0) == true)) continue;
            final Class class3 = super.introspector.getClass(field1);
            if (class3 == null) continue;
            if (!(super.introspector.checkSameClasses(class2, class3) == true)) continue;
            field1Checker = true;
            break;
        }
        if (field1Checker == false) return false;
        return true;
    }

    public boolean solveEval2() {
        final Class class1 = super.introspector.getClass("MiPila");
        if (class1 == null) return false;
        super.intercessor.copyField(class1, "elArray");
        return true;
    }

    public String[] testEval2() {
        return null;
    }

    public boolean checkEval3() {
        final Class class1 = super.introspector.getClass("MiPila");
        if (class1 == null) return false;
        final Class[] classs1 = {  };
        if (!(super.introspector.checkDeclaredConstructor(class1, classs1, true) == true)) return false;
        return true;
    }

    public boolean solveEval3() {
        final Class class1 = super.introspector.getClass("MiPila");
        if (class1 == null) return false;
        final Class[] classs1 = {  };
        super.intercessor.removeConstructors(class1);
        super.intercessor.copyConstructor(class1, classs1);
        return true;
    }

    public String[] testEval3() {
        return null;
    }

    public boolean checkEval4() {
        final Class class1 = super.introspector.getClass("MiPila");
        if (class1 == null) return false;
        final Class[] classs1 = { Object.class };
        if (!(super.introspector.getGenericTypeParameterCount(class1) == 1)) return false;
        if (!(super.introspector.checkDeclaredMethod(class1, "apilar", classs1, true) == true)) return false;
        return true;
    }

    public boolean solveEval4() {
        final Class class1 = super.introspector.getClass("MiPila");
        if (class1 == null) return false;
        final Class[] classs1 = { Object.class };
        super.intercessor.copyMethod(class1, "apilar", classs1);
        return true;
    }

    public String[] testEval4() {
        return null;
    }

    public boolean checkEval5() {
        final Class class1 = super.introspector.getClass("MiPila");
        if (class1 == null) return false;
        final Class[] classs1 = {  };
        if (!(super.introspector.getGenericTypeParameterCount(class1) == 1)) return false;
        boolean typeVariable1Checker = false;
        for (TypeVariable typeVariable1 : super.introspector.getGenericTypeParameters(class1)) {
            if (!(super.introspector.checkDeclaredMethod(class1, "desapilar", classs1, typeVariable1, true) == true)) continue;
            typeVariable1Checker = true;
            break;
        }
        if (typeVariable1Checker == false) return false;
        return true;
    }

    public boolean solveEval5() {
        final Class class1 = super.introspector.getClass("MiPila");
        if (class1 == null) return false;
        final Class[] classs1 = {  };
        super.intercessor.copyMethod(class1, "desapilar", classs1);
        return true;
    }

    public String[] testEval5() {
        return null;
    }

    public boolean checkEval6() {
        final Class class1 = super.introspector.getClass("MiPila");
        if (class1 == null) return false;
        final Class[] classs1 = {  };
        if (!(super.introspector.getGenericTypeParameterCount(class1) == 1)) return false;
        boolean typeVariable1Checker = false;
        for (TypeVariable typeVariable1 : super.introspector.getGenericTypeParameters(class1)) {
            if (!(super.introspector.checkDeclaredMethod(class1, "cima", classs1, typeVariable1, true) == true)) continue;
            typeVariable1Checker = true;
            break;
        }
        if (typeVariable1Checker == false) return false;
        return true;
    }

    public boolean solveEval6() {
        final Class class1 = super.introspector.getClass("MiPila");
        if (class1 == null) return false;
        final Class[] classs1 = {  };
        super.intercessor.copyMethod(class1, "cima", classs1);
        return true;
    }

    public String[] testEval6() {
        return null;
    }

    public boolean checkEval7() {
        final Class class1 = super.introspector.getClass("MiPila");
        if (class1 == null) return false;
        final Class[] classs1 = {  };
        if (!(super.introspector.checkDeclaredMethod(class1, "esVacia", classs1, boolean.class, true) == true)) return false;
        return true;
    }

    public boolean solveEval7() {
        final Class class1 = super.introspector.getClass("MiPila");
        if (class1 == null) return false;
        final Class[] classs1 = {  };
        super.intercessor.copyMethod(class1, "esVacia", classs1);
        return true;
    }

    public String[] testEval7() {
        if (!(super.tester.executeTestCases("AutomaticTestCases2") >= 90.0)) return new String[] { "AutomaticTestCases2" };
        return null;
    }

    public boolean checkEval8() {
        final Class class1 = super.introspector.getClass("MiPila");
        if (class1 == null) return false;
        final Class[] classs1 = {  };
        if (!(super.introspector.checkDeclaredMethod(class1, "talla", classs1, int.class, true) == true)) return false;
        return true;
    }

    public boolean solveEval8() {
        final Class class1 = super.introspector.getClass("MiPila");
        if (class1 == null) return false;
        final Class[] classs1 = {  };
        super.intercessor.copyMethod(class1, "talla", classs1);
        return true;
    }

    public String[] testEval8() {
        if (!(super.tester.executeTestCases("AutomaticTestCases1") >= 90)) return new String[] { "AutomaticTestCases1" };
        return null;
    }

    public boolean checkEval9() {
        final Class class1 = super.introspector.getClass("MiPila");
        if (class1 == null) return false;
        final Class[] classs1 = {  };
        if (!(super.introspector.checkDeclaredMethod(class1, "toString", classs1, String.class, true) == true)) return false;
        return true;
    }

    public boolean solveEval9() {
        final Class class1 = super.introspector.getClass("MiPila");
        if (class1 == null) return false;
        final Class[] classs1 = {  };
        super.intercessor.copyMethod(class1, "toString", classs1);
        return true;
    }

    public String[] testEval9() {
        return null;
    }
}