public void testCanCreateOneNewLeaf() {
BasicTreeBranchPart part;
TreeBranchPartState partState = new TreeBranchPartState();
partState.setEnergy(new BigDecimal(89));
part = new BasicTreeBranchPart(new MockUniverse(), partState);
assertFalse(part.canCreateOneNewLeaf());
partState.setEnergy(new BigDecimal(150));
part = new BasicTreeBranchPart(new MockUniverse(), partState);
assertTrue(part.canCreateOneNewLeaf());
List<TreeLeafState> leaveStates = new ArrayList<TreeLeafState>();
leaveStates.add(new TreeLeafState());
leaveStates.add(new TreeLeafState());
leaveStates.add(new TreeLeafState());
partState.setLeaveStates(leaveStates);
part = new BasicTreeBranchPart(new MockUniverse(), partState);
assertTrue(part.canCreateOneNewLeaf());
leaveStates.add(new TreeLeafState());
part = new BasicTreeBranchPart(new MockUniverse(), partState);
assertFalse(part.canCreateOneNewLeaf());
}