@Test public void checkOnlyValueTypesReturned() { Neo4JValueCoercer neo4jValueCoercer = new Neo4JValueCoercer(); assertTrue(neo4jValueCoercer.coerce(new Object()) instanceof String); assertEquals(1l, neo4jValueCoercer.coerce(Long.valueOf(1l))); assertEquals(1.0, neo4jValueCoercer.coerce(Double.valueOf(1.0))); assertEquals("1", neo4jValueCoercer.coerce(Integer.valueOf(1))); assertEquals(1l, neo4jValueCoercer.coerce(1l)); assertEquals(1.0, neo4jValueCoercer.coerce(1.0)); assertEquals("1", neo4jValueCoercer.coerce(1)); assertEquals("test", neo4jValueCoercer.coerce("test")); assertEquals("[1, test]", neo4jValueCoercer.coerce(ImmutableList.of(1, "test"))); }
@Override public Object coerce(Object value) { if (value instanceof Boolean || value instanceof Long || value instanceof Double || value instanceof String) { return value; } else { return value.toString(); } }
Neo4JValueCoercer implements ValueCoercer { @Override public Object coerce(Object value) { if (value instanceof Boolean || value instanceof Long || value instanceof Double || value instanceof String) { return value; } else { return value.toString(); } } }
Neo4JValueCoercer implements ValueCoercer { @Override public Object coerce(Object value) { if (value instanceof Boolean || value instanceof Long || value instanceof Double || value instanceof String) { return value; } else { return value.toString(); } }  }
Neo4JValueCoercer implements ValueCoercer { @Override public Object coerce(Object value) { if (value instanceof Boolean || value instanceof Long || value instanceof Double || value instanceof String) { return value; } else { return value.toString(); } }  @Override Object coerce(Object value); }
Neo4JValueCoercer implements ValueCoercer { @Override public Object coerce(Object value) { if (value instanceof Boolean || value instanceof Long || value instanceof Double || value instanceof String) { return value; } else { return value.toString(); } }  @Override Object coerce(Object value);  }