let's say that I have several `Creature` subclasses, and that they have each have some sort of `getGroup()` method that returns a `List<Creature>`.

What I mean by *"some sort of"* `.getGroup()` method is that the name of this function varies between subclasses. For instance, `Wolf`s travel in packs, so they have a `getPack()` member. `Fish` travel in schools, so they have a `.getSchool()` member, `Humans` have a `getFamily()` member, and so on. 

**`.getGroup()` doesn not exist in `Creature`, and it cannot be added to the interface. None of these clases can be edited.**

I'm writing a method to print the number of `Creature`s in their group. How would I do this?

Essentially, I'm looking to condense these two functions into the same thing:

```
    public void PrintSchoolSize(Fish dory) {
        System.out.print(dory.getSchool().size());
    }

    public void PrintHiveSize(Bee bee) {
        System.out.print(bee.getColony().size());
    }

```

...into the following function:

```
    public void printGroupSize( Class<? extends Creature> cree, 
                                FunctionThatReturnsList getGroup() ) {
        System.out.print(cree.getGroup().size();
    }

```

I'd imagine I need to pass in a second argument (function pointer?) to `void printGroupSize`. Any help is very appreciated, thanks!

**EDIT Thank you all for the help. This is just a simplification of the *real* problem I'm trying to solve. Long, overly complex problems are tougher to answer, so I posed this simpler scenario.**

**The only answer lies in using a generic function (if that exists).** The classes I'm actually working with don't have a common interface, but they all have a function that returns a List.