code: private void writeClassDescriptions(BeanReferences references) throws IOException {
          // write out ref count first, which is the number of instances that are referenced
          output.writeInt(references.getReferences().size());
  
          // write map of class name to a list of metatype names (which is empty if not a bean)
          List<ClassInfo> classInfos = references.getClassInfoList();
          output.writeMapHeader(classInfos.size());
          for (ClassInfo classInfo : classInfos) {
              // known types parameter is null as we never serialize the class names again
              String className = SerTypeMapper.encodeType(classInfo.type, settings, null, null);
              output.writeString(className);
  
              output.writeArrayHeader(classInfo.metaProperties.length);
              for (MetaProperty<?> property : classInfo.metaProperties) {
                  output.writeString(property.name());
              }
          }
      }
docs: determines what beans occur more than once and setup references