public void testSystem(Class ivc, int numc, int numv) throws java.lang.InstantiationException, java.lang.IllegalAccessException { IndexVotable iv = (IndexVotable) ivc.newInstance(); IndexVotable nv = (IndexVotable) ivc.newInstance(); generateRandomVotes(numc, numv); for (int i = 0; i < numv; i++) { iv.voteIndexVoteSet(ivotes[i]); nv.voteRating(votes[i]); } NameVotingSystem.NameVote[] ivw = iv.getWinners(); NameVotingSystem.NameVote[] nvw = nv.getWinners(); boolean good = SummableVotingSystemTest.winnersEq(ivw, nvw); if (!good) { StringBuffer sb = new StringBuffer("index vote=\n"); sbWinners(sb, ivw); sb.append("name vote=\n"); sbWinners(sb, nvw); fail(sb.toString()); } }