code: public void ensureUniqueProperties() {
      masterPropertyMetadataMap.clear();
      for (PropertyMetadata propertyMetadata : getPropertyMetadataCollection()) {
        updateMasterPropertyMetadataMap(propertyMetadata.getMappedName(), propertyMetadata.getName());
      }
      // top level embedded objects
      for (EmbeddedMetadata embeddedMetadata : getEmbeddedMetadataCollection()) {
        ensureUniqueProperties(embeddedMetadata, embeddedMetadata.getStorageStrategy());
      }
    }
docs: Validates this metadata to ensure there are no duplicate property names defined in this
  entity/embedded objects.