if (group == null || fileFactory == null) {
throw new IllegalStateException("Required objects have not been injected.");
}
// check that the fileFactory's group is an ancestor of this group
StatisticGroup fileFactoryGroup = fileFactory.getStatisticGroup();
if (fileFactoryGroup.isAncestor(group)) {
fileFactory.setStatisticGroup(group);
}
else {
throw new IllegalStateException("StatisticGroup objects are inconsistent.");
}