public class NodeEntityInstantiationTests extends EntityTestBase {
@Test
@Transactional
public void testCreatePersonWithCreator() {
Person p = persistedPerson("Rod", 39);
long nodeId = getNodeId(p);
Node node = neo4jTemplate.getNode(nodeId);
final MappingPolicy mappingPolicy = neo4jTemplate.getMappingPolicy(Person.class);
Person person1 = (Person) neo4jTemplate.createEntityFromStoredType(node, mappingPolicy);
assertEquals("Rod", person1.getName());
Person person2 = neo4jTemplate.createEntityFromState(node,Person.class, mappingPolicy);
assertEquals("Rod", person2.getName());
GraphRepository<Person> finder = neo4jTemplate.repositoryFor(Person.class);
Person found = finder.findOne(nodeId);
assertEquals("Rod", found.getName());
}