Buggy code:
public class PublishAndSendElection { private static Logger log = Logger . getLogger ( PublishAndSendElection . class . getName ( ) ) ; private static EventVS eventVS ; private static VotingSimulationData simulationData ; private static boolean isWithVoteCancellation = false ; private static String publisherNIF = "00111222V" ; private static List < String > synchronizedElectorList ; private static ExecutorService simulatorExecutor ; private static ExecutorCompletionService responseService ; private static final Map < String , VoteHelper > voteMap = new ConcurrentHashMap < > ( ) ; public static void main ( String [ ] args ) throws Exception { new ContextVS ( null , null ) . initEnvironment ( Thread . currentThread ( ) . getContextClassLoader ( ) . getResourceAsStream ( "TestsApp.properties" ) , ".//TestDir" ) ; PublishAndSendElection . eventVS = new EventVS ( ) ; PublishAndSendElection . eventVS . setSubject ( "voting<seq2seq4repair_space>subject" ) ; PublishAndSendElection . eventVS . setContent ( Base64 . getEncoder ( ) . encodeToString ( "<p>election<seq2seq4repair_space>content<//p>" . getBytes ( ) ) ) ; PublishAndSendElection . eventVS . setFieldsEventVS ( Sets . newHashSet ( new FieldEvent ( "field1" , null ) , new FieldEvent ( "field2" , null ) ) ) ; UserBaseSimulationData userBaseSimulationData = new UserBaseSimulationData ( ) ; userBaseSimulationData . setUserIndex ( 100 ) ; userBaseSimulationData . setNumUsersWithoutRepresentative ( 20 ) ; userBaseSimulationData . setNumUsersWithoutRepresentativeWithVote ( 15 ) ; <START_BUG> userBaseSimulationData . setNumRepresentatives ( 0 ) ; <END_BUG> userBaseSimulationData . setNumRepresentativesWithVote ( 0 ) ; userBaseSimulationData . setNumUsersWithRepresentative ( 0 ) ; userBaseSimulationData . setNumUsersWithRepresentativeWithVote ( 0 ) ; PublishAndSendElection . simulationData = new VotingSimulationData ( ) ; PublishAndSendElection . simulationData . setServerURL ( "https:////192.168.1.5//AccessControl" ) ; PublishAndSendElection . simulationData . setMaxPendingResponses ( 50 ) ; PublishAndSendElection . simulationData . setUserBaseData ( userBaseSimulationData ) ; PublishAndSendElection . simulationData . setEventVS ( PublishAndSendElection . eventVS ) ; Map timerMap = new HashMap < > ( ) ; timerMap . put ( "active" , false ) ; timerMap . put ( "time" , "00:00:10" ) ; PublishAndSendElection . simulationData . setTimerMap ( timerMap ) ; ResponseVS responseVS = HttpHelper . getInstance ( ) . getData ( Actor . getServerInfoURL ( PublishAndSendElection . simulationData . getServerURL ( ) ) , JSON ) ; if ( ( ResponseVS . SC_OK ) != ( responseVS . getStatusCode ( ) ) ) throw new org . votingsystem . throwable . ExceptionVS ( responseVS . getMessage ( ) ) ; Actor actor = ( ( org . votingsystem . dto . ActorDto ) ( responseVS . getMessage ( org . votingsystem . dto . ActorDto . class ) ) ) . getActor ( ) ; if ( ! ( actor instanceof AccessControl ) ) throw new org . votingsystem . throwable . ExceptionVS ( ( "Expected<seq2seq4repair_space>access<seq2seq4repair_space>control<seq2seq4repair_space>but<seq2seq4repair_space>found<seq2seq4repair_space>" + ( actor . getType ( ) . toString ( ) ) ) ) ; ContextVS . getInstance ( ) . setAccessControl ( ( ( AccessControl ) ( actor ) ) ) ; PublishAndSendElection . eventVS = PublishAndSendElection . publishEvent ( PublishAndSendElection . simulationData . getEventVS ( ) , PublishAndSendElection . publisherNIF , "publishElectionMsgSubject" ) ; PublishAndSendElection . simulatorExecutor = Executors . newFixedThreadPool ( 100 ) ; CountDownLatch userBaseDataLatch = new CountDownLatch ( 1 ) ; PublishAndSendElection . simulationData . getUserBaseData ( ) . sendData ( userBaseDataLatch ) ; userBaseDataLatch . await ( ) ; PublishAndSendElection . sendVotes ( ( ( VotingSimulationData ) ( PublishAndSendElection . simulationData ) ) . getUserBaseData ( ) ) ; } private static void sendVotes ( UserBaseSimulationData userBaseSimulationData ) throws Exception { } public static void sendVoteRequests ( UserBaseSimulationData userBaseSimulationData ) throws Exception { } private static void waitForVoteResponses ( ) throws Exception { } private static EventVS publishEvent ( EventVS eventVS , String publisherNIF , String cmsMessageSubject ) throws Exception { } public static void startSimulationTimer ( SimulationData simulationData ) throws Exception { } private static void changeEventState ( String publisherNIF ) throws Exception { } private static void cancelVote ( VoteHelper voteHelper , String nif ) throws Exception { } }

Fix:
userBaseSimulationData . setNumRepresentatives ( 10 ) ;