int (GrIfStatement statement) { final GrStatement branch = statement.getElseBranch(); if (branch == null) { return 1; } if (!(branch instanceof GrIfStatement)) { return 2; } return 1 + calculateNumBranches((GrIfStatement) branch); }