private void addDegreesForNode(Read dataRead, NodeCursor node, NodeCursor other, List<Degree> degrees, RelationshipGroupCursor relationshipGroup, int[][] typedDirections) {
long nodeId = node.nodeReference();
long otherId = other.nodeReference();
dataRead.relationshipGroups(nodeId, node.relationshipGroupReference(), relationshipGroup);
while (relationshipGroup.next()) {
int type = relationshipGroup.type();
if ((typedDirections==null) || (arrayContains(typedDirections[0], type))) {
addDegreeWithDirection(degrees, relationshipGroup.outgoingReference(), relationshipGroup.outgoingCount(), nodeId, otherId);
}
if ((typedDirections==null) || (arrayContains(typedDirections[1], type))) {
addDegreeWithDirection(degrees, relationshipGroup.incomingReference(), relationshipGroup.incomingCount(), nodeId, otherId);
}
}
}