Buggy code:
public class NpcWorld implements World { private NpcPopulation population ; private int oldAge ; private double mutationChance ; private double crossoverChance ; private double deathChance ; private int eatingCapacity ; private int sleepingCapacity ; private int matingCapacity ; private int eatingAvailability ; private int sleepingAvailability ; private int matingAvailability ; private int maxHunger ; private int maxSleepiness ; private int hungerChange ; private int sleepinessChange ; private int stepNumber ; private int currentID ; public NpcWorld ( ) { } public void setMutationChance ( double c ) { } public void setCrossoverChance ( double c ) { } public void setDeathChance ( double c ) { } public void setEatingCapacity ( int c ) { } public void setSleepingCapacity ( int c ) { } public void setMatingCapacity ( int c ) { } public void setHungerChange ( int c ) { } public void setSleepinessChange ( int c ) { } public Dna crossover ( Dna d1 , Dna d2 ) { } public Dna mutate ( Dna d ) { } public Population merge ( Population p1 , Population p2 ) { } public void step ( ) { System . out . println ( ( "Step<seq2seq4repair_space>number<seq2seq4repair_space>" + ( stepNumber ) ) ) ; ( stepNumber ) ++ ; ArrayList < Integer > keys = new ArrayList < Integer > ( population . getKeys ( ) ) ; Collections . shuffle ( keys ) ; for ( Integer k : keys ) { NpcIndividual curIndividual = ( ( NpcIndividual ) ( population . get ( k ) ) ) ; if ( ( curIndividual . getStepsRemaining ( ) ) == 0 ) { if ( ( curIndividual . getCurrentAction ( ) ) == ( Const . EATING ) ) { ( eatingAvailability ) ++ ; } else if ( ( curIndividual . getCurrentAction ( ) ) == ( Const . SLEEPING ) ) { ( sleepingAvailability ) ++ ; } } } ArrayList < NpcIndividual > matingPoolMales = new ArrayList < NpcIndividual > ( ) ; ArrayList < NpcIndividual > matingPoolFemales = new ArrayList < NpcIndividual > ( ) ; for ( Integer k : keys ) { NpcIndividual curIndividual = ( ( NpcIndividual ) ( population . get ( k ) ) ) ; if ( ( curIndividual . getStepsRemaining ( ) ) == 0 ) { ArrayList < Integer > actions = new ArrayList < Integer > ( ) ; if ( ( eatingAvailability ) > 0 ) { actions . add ( EATING ) ; } if ( ( sleepingAvailability ) > 0 ) { actions . add ( SLEEPING ) ; } if ( ( matingAvailability ) > 0 ) { actions . add ( MATING ) ; } actions . add ( PLAYING ) ; int action = curIndividual . chooseAction ( actions ) ; if ( action == ( Const . EATING ) ) { ( eatingAvailability ) -- ; } else if ( action == ( Const . SLEEPING ) ) { ( sleepingAvailability ) -- ; } else if ( action == ( Const . MATING ) ) { ( matingAvailability ) -- ; if ( ( curIndividual . getGender ( ) ) == ( Const . MALE ) ) { matingPoolMales . add ( curIndividual ) ; } else { <START_BUG> matingPoolFemales . add ( curIndividual ( ) ) ; <END_BUG> } } } curIndividual . decreaseStepsRemaining ( ) ; if ( ( curIndividual . getCurrentAction ( ) ) == ( Const . EATING ) ) { curIndividual . decreaseHunger ( hungerChange ) ; } else if ( ( curIndividual . getCurrentAction ( ) ) == ( Const . SLEEPING ) ) { curIndividual . decreaseSleepiness ( sleepinessChange ) ; } curIndividual . increaseHunger ( ) ; curIndividual . increaseSleepiness ( ) ; curIndividual . increaseAge ( ) ; if ( ( curIndividual . getHunger ( ) ) > ( maxHunger ) ) { population . remove ( curIndividual ) ; } } reproduce ( matingPoolMales , matingPoolFemales ) ; } public void reproduce ( ArrayList < Individual > males , ArrayList < Individual > females ) { } public Population getPopulation ( ) { } public Individual mate ( Individual i1 , Individual i2 ) { } }

Fix:
matingPoolFemales . add ( curIndividual ) ;