import java.util.*;
import org.python.core.PyList;

public class JavaSuiteAndTestCountListener {
    public static final String ROBOT_LISTENER_API_VERSION = "2";
    private final Map<String, int[]>  data = new HashMap<String, int[]>() {{
        put("Subsuites & Subsuites2", new int[] {0,2,4});
        put("Subsuites", new int[] {0,2,2});
        put("Sub1", new int[] {1,0,1});
        put("Sub2", new int[] {1,0,1});
        put("Subsuites2", new int[] {0,1,2});
        put("Subsuite3", new int[] {2,0,2});
    }};
    
    public void startSuite(String name, Map attrs) {
        int[] expCounts = data.get(name);
        checkCount(expCounts[0], getActual(attrs, "tests"));
        checkCount(expCounts[1], getActual(attrs, "suites"));
        checkCount(expCounts[2], getActual(attrs, "totaltests"));
    }

    private int getActual(Map attrs, String key) {
        Object item = attrs.get(key);
        try {
            return ((PyList) item).size();
        } catch (ClassCastException e) {
            return ((Integer) attrs.get(key)).intValue();
        }
    }

    private void checkCount(int expected, int actual) {
        if (actual != expected) {
            throw new RuntimeException("Counts differ");
        }
    }
}

@@ -502,24 +502,73 @@
 %5D %7B2,0,2%7D);%0A
+        put(%22Sub.Suite.4%22, new int%5B%5D %7B1, 0, 1%7D);%0A
     %7D%7D;%0A    

fix java listener (not class file yet(