 Protandry is when an individual starts out male and becomes female while the reverse condition is known as protogyny , the latter being more common . Changing sex can occur in various contexts . In the bluestreak cleaner wrasse , where males have harems of up to ten females , if the male is removed the largest and most dominant female develops male @-@ like behaviour and eventually testes . If she is removed , the next ranking female takes her place . In the species Anthias squamipinnis , where individuals gather into large groups and females greatly outnumber males , if a certain number of males are removed from a group , the same number of females change sex and replace them . In clownfish , individuals live in groups and only the two largest in a group breed : the largest female and the largest male . If the female dies , the male switches sexes and the next largest male takes his place . 
