With GroupCountFunctionPipe, you can pass two functions, one that generates a key for the incoming object and a second that generates a number from the number previously existing for that key.
Regarding the second function, I have many times stumbled on trying to use a property of the incoming element as a modulator of the count value. To rectify this situation, the value function now takes a Pair<?, Number> and emits a Number. Thus, you can now do stuff like this:
gremlin> g.v(1).outE('knows').groupCount{it.inVertex}{it.a.weight + it.b}.cap.next()
==>v[2]=0.5
==>v[4]=1.0
That is, weight (via groupCount) friends by the strength of the their edge weights. You could do this before, but it required some magic using sideEffects and variables.
Anywho, a Pair is a Pipes structure class that is simple: Pair.getA(), Pair.getB(). For GroupCountFunctionPipe, getA() is the object flowing through the stream and getB() is the last numeric value in the Map associated with the key of that object.
I hope that is clear and you find it as useful as I do.
SIDENOTE: I also did some package reorganizing of com.tinkerpop.pipes.util so be wary if your SNAPSHOT code doesn't compile.
Thanks,
Marko.