int nbParts = Randomizer.randomBetween(2, 4);
List<TreeBranchPartState> branchPartStates = new ArrayList<TreeBranchPartState>(nbParts);
for (int i = 0; i < nbParts; i++) {
branchPartStates.add(createRandomTreeBranchPartState());
}
TreeBranch3DState branch3DState = DisplayDataCreatorForTests.createRandomTreeBranch3DState();
return new TreeBranchState(createRandomId(), age, energy, freeEnergy, branchPartStates, branch3DState);
}