### Question:
PropertyFactory { public static <K, V extends Persistent> MapProperty<K, V> createMap(String name, Expression expression, Class<K> keyType, Class<V> entityType) { return new MapProperty<>(name, expression, keyType, entityType); }  static BaseProperty<T> createBase(String name, Expression expression, Class<T> type); static BaseProperty<T> createBase(String name, Class<T> type); static BaseProperty<T> createBase(Expression expression, Class<T> type); static StringProperty<T> createString(String name, Expression expression, Class<T> type); static StringProperty<T> createString(String name, Class<T> type); static StringProperty<T> createString(Expression expression, Class<T> type); static NumericProperty<T> createNumeric(String name, Expression expression, Class<T> type); static NumericProperty<T> createNumeric(String name, Class<T> type); static NumericProperty<T> createNumeric(Expression expression, Class<T> type); static DateProperty<T> createDate(String name, Expression expression, Class<T> type); static DateProperty<T> createDate(String name, Class<T> type); static DateProperty<T> createDate(Expression expression, Class<T> type); static EntityProperty<T> createEntity(String name, Expression expression, Class<T> entityType); static EntityProperty<T> createEntity(String name, Class<T> type); static EntityProperty<T> createEntity(Expression expression, Class<T> type); static EntityProperty<T> createSelf(Class<T> type); static EntityProperty<T> createSelf(Expression expression, Class<T> type); static ListProperty<T> createList(String name, Expression expression, Class<T> entityType); static ListProperty<T> createList(String name, Class<T> entityType); static SetProperty<T> createSet(String name, Expression expression, Class<T> entityType); static SetProperty<T> createSet(String name, Class<T> entityType); static MapProperty<K, V> createMap(String name, Expression expression, Class<K> keyType, Class<V> entityType); static MapProperty<K, V> createMap(String name, Class<K> keyType, Class<V> entityType); static EmbeddableProperty<T> createEmbeddable(String name, Class<T> embeddableType); static EmbeddableProperty<T> createEmbeddable(String name, Expression exp, Class<T> embeddableType); static BaseIdProperty<T> createBaseId(String attribute, String entityName, Class<T> propertyType); static BaseIdProperty<T> createBaseId(String attribute, String path, String entityName, Class<T> propertyType); static NumericIdProperty<T> createNumericId(String attribute, String entityName, Class<T> propertyType); static NumericIdProperty<T> createNumericId(String attribute, String path, String entityName, Class<T> propertyType); static final NumericProperty<Long> COUNT; static final DateProperty<LocalDateTime> NOW; }### Answer:
@Test public void createMap() { MapProperty<Integer, Artist> property = PropertyFactory .createMap("path", Integer.class, Artist.class); assertEquals("path", property.getName()); assertEquals(exp("path"), property.getExpression()); assertEquals(Map.class, property.getType()); assertEquals(Integer.class, property.getKeyType()); assertEquals(Artist.class, property.getEntityType()); }
@Test public void createMap1() { MapProperty<Integer, Artist> property = PropertyFactory .createMap("path", exp("path+.sub"), Integer.class, Artist.class); assertEquals("path", property.getName()); assertEquals(exp("path+.sub"), property.getExpression()); assertEquals(Map.class, property.getType()); assertEquals(Integer.class, property.getKeyType()); assertEquals(Artist.class, property.getEntityType()); }