### Question:
PathBuilder extends EntityPathBase<T> { private String toString(Path<?> path) { return path.getMetadata().getElement().toString(); } PathBuilder(Class<? extends T> type, PathMetadata pathMetadata, PathBuilderValidator validator);  PathBuilder(Class<? extends T> type, PathMetadata pathMetadata);  PathBuilder(Class<? extends T> type, String variable, PathBuilderValidator validator);  PathBuilder(Class<? extends T> type, String variable); @Override Object getMetadata(Path<?> property); @SuppressWarnings("unchecked") PathBuilder<Object> get(String property); @SuppressWarnings("unchecked") PathBuilder<A> get(String property, Class<A> type); ArrayPath<A, E> getArray(String property, Class<A> type); BooleanPath get(BooleanPath path); BooleanPath getBoolean(String propertyName); CollectionPath<A, PathBuilder<A>> getCollection(String property, Class<A> type); CollectionPath<A, E> getCollection(String property, Class<A> type, Class<? super E> queryType); @SuppressWarnings("unchecked") ComparablePath<A> get(ComparablePath<A> path); @SuppressWarnings("unchecked") ComparablePath<A> getComparable(String property, Class<A> type); @SuppressWarnings("unchecked") DatePath<A> get(DatePath<A> path); @SuppressWarnings("unchecked") DatePath<A> getDate(String property, Class<A> type); @SuppressWarnings("unchecked") DateTimePath<A> get(DateTimePath<A> path); @SuppressWarnings("unchecked") DateTimePath<A> getDateTime(String property, Class<A> type); EnumPath<A> getEnum(String property, Class<A> type); @SuppressWarnings("unchecked") EnumPath<A> get(EnumPath<A> path); ListPath<A, PathBuilder<A>> getList(String property, Class<A> type); ListPath<A, E> getList(String property, Class<A> type, Class<? super E> queryType); MapPath<K, V, PathBuilder<V>> getMap(String property, Class<K> key, Class<V> value); MapPath<K, V, E> getMap(String property, Class<K> key, Class<V> value, Class<? super E> queryType); @SuppressWarnings("unchecked") NumberPath<A> get(NumberPath<A> path); @SuppressWarnings("unchecked") NumberPath<A> getNumber(String property, Class<A> type); SetPath<A, PathBuilder<A>> getSet(String property, Class<A> type); SetPath<A, E> getSet(String property, Class<A> type, Class<? super E> queryType); @SuppressWarnings("unchecked") SimplePath<A> get(Path<A> path); @SuppressWarnings("unchecked") SimplePath<A> getSimple(String property, Class<A> type); StringPath get(StringPath path); StringPath getString(String property); @SuppressWarnings("unchecked") TimePath<A> get(TimePath<A> path); @SuppressWarnings("unchecked") TimePath<A> getTime(String property, Class<A> type);  }### Answer:
@Test public void getByExample() { User user = new User(); user.setFirstName("firstName"); user.setLastName("lastName"); String byExample = getByExample(user).toString(); assertTrue(byExample.contains("entity.lastName = lastName")); assertTrue(byExample.contains("entity.firstName = firstName")); }