public RecordProxy<Long, RelationshipGroupRecord, Integer> getRelationshipGroup(
     NodeRecord node, int type) {
   long groupId = node.getNextRel();
   long previousGroupId = Record.NO_NEXT_RELATIONSHIP.intValue();
   Set<Integer> allTypes = new HashSet<>();
   while (groupId != Record.NO_NEXT_RELATIONSHIP.intValue()) {
     RecordProxy<Long, RelationshipGroupRecord, Integer> change =
         recordChangeSet.getRelGroupRecords().getOrLoad(groupId, type);
     RelationshipGroupRecord record = change.forReadingData();
     record.setPrev(previousGroupId); // not persistent so not a "change"
     allTypes.add(record.getType());
     if (record.getType() == type) {
       return change;
     }
     previousGroupId = groupId;
     groupId = record.getNext();
   }
   return null;
 }