code: boolean isChild(int childId, int parentId, short weight) {
          State parent = state(parentId);
          State child;
          return parent.children.containsKey(childId) &&
                  (child = state(childId)).parent == parent && child.weight == weight;
      }
docs: For testing only!