import java.lang.reflect.Field;

public class TestCases2 {

    public boolean test1() throws Throwable {
        GrupoFiguras g = new GrupoFiguras();

        Field listaFigurasField = this.getDeclaredField(GrupoFiguras.class, "listaFiguras");
        if (listaFigurasField == null)
        	return false;
        Object listaFigurasValue1 = this.getDeclaredFieldValue(GrupoFiguras.class, g, "listaFiguras");
        if (!(listaFigurasValue1 != null && listaFigurasValue1 instanceof Figura[]))
        	return false;
        Figura[] listaFiguras = (Figura[]) listaFigurasValue1;

        for (int index = 0; index < listaFiguras.length; index++)
        	if (listaFiguras[index] != null)
        		return false;

        Cuadrado cua = new Cuadrado(3.0, 5.0, 2.2);
        g.anyadeCuadrado(cua);

        int timesFound = 0;
        for (int index = 0; index < listaFiguras.length; index++)
        	if (listaFiguras[index] != null)
        		timesFound++;
        if (timesFound == 1)
        	return true;

        return false;
    }

    private Field getDeclaredField(Class<?> clazz, String fieldName) throws SecurityException {
    	try {
    		return clazz.getDeclaredField(fieldName);
    	}
    	catch (NoSuchFieldException e) {
    		return null;
    	}
    }
    private Object getDeclaredFieldValue(Class<?> clazz, Object obj, String fieldName) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
    	Field field = this.getDeclaredField(clazz, fieldName);

    	field.setAccessible(true);

    	return field.get(obj);
    }
}