code: public static Map<String, Object> getKeyPropertyValues(EntityType entityType, Object entity) {
          Map<String, Object> keyPropertyValues = new HashMap<>();
          for (PropertyRef propertyRef : entityType.getKey().getPropertyRefs()) {
              String propertyName = propertyRef.getPath();
              Object propertyValue = getPropertyValue(entityType.getStructuralProperty(propertyName), entity);
              keyPropertyValues.put(propertyName, propertyValue);
          }
          return keyPropertyValues;
      }
docs: Gets the values of the properties that part of the key of an entity type.
  
  @param entityType The entity type.
  @param entity     The entity.
  @return A {@code Map} containing the values of the key properties of the entity, mapped by property name.