code: private static <S, L> void updateBlockReferences(Block<S, L> block) {
          UnorderedCollection<State<S, L>> states = block.getStates();
          for (ElementReference ref : states.references()) {
              State<S, L> state = states.get(ref);
              state.setBlockReference(ref);
              state.setBlock(block);
          }
      }
docs: Sets the blockReference-attribute of each state in the collection to the corresponding ElementReference of the
  collection.