public static void main(String[] args) throws IOException {
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("classpath:ReadWriteTests-context.xml");
boolean delete = false;
try {
Neo4jTemplate template = ctx.getBean(Neo4jTemplate.class);
Car car = findOne(template);
if (car != null) {
delete = true;
assertEquals(Volvo.class, car.getClass());
} else {
Transaction tx = template.getGraphDatabase().beginTx();
Volvo volvo = template.save(new Volvo());
assertEquals(1, volvo.id.intValue());
tx.success();