When niching or speciation is required to perform a task that has several different component parts, standard genetic algorithms (GAs) struggle. They tend to evaluate and select all individuals on the same part of the task, which leads to genetic convergence within the population. The goal of evolutionary niching methods is to enforce diversity in the population so that this genetic convergence is avoided. One drawback with some of these niching methods is that they require a priori knowledge or assumptions about the specific fitness landscape in order to work; another is that many such methods are not set up to work on cooperative tasks where fitness is only relevant at the group level. Here we address these problems by presenting the group GA, described earlier by the authors, which is a group-based evolutionary algorithm that can lead to emergent niching. After demonstrating the group GA on an immune system matching task, we extend the previous work and present two modified versions where the number of niches does not need to be specified ahead of time. In the random-group-size GA, the number of niches is varied randomly during evolution, and in the evolved-group-size GA the number of niches is optimized by evolution. This provides a framework in which we can evolve groups of individuals to collectively perform tasks with minimal a priori knowledge of how many subtasks there are or how they should be shared out.