HttpNeo4jResultSetMetaData extends Neo4jResultSetMetaData { @SuppressWarnings("unchecked") @Override public String getColumnClassName(int column) throws SQLException { final Object object = ((List<Object>) this.result.getRows().get(0).get("row")).get(column - 1); if (object == null) { return null; } for (Map.Entry<Class, Class> entry : CLASSES_ASSOCIATIONS.entrySet()) { if (entry.getKey().isInstance(object)) { return entry.getValue().getName(); } } return Object.class.getName(); } HttpNeo4jResultSetMetaData(Neo4jResult result); @SuppressWarnings("unchecked") @Override int getColumnType(int column); @SuppressWarnings("unchecked") @Override String getColumnClassName(int column);  }
@Test public void getColumnClassNameShouldReturnTheCorrectValue() throws SQLException { assertEquals(null, this.httpResultSetMetadata.getColumnClassName(1)); assertEquals("java.lang.String", this.httpResultSetMetadata.getColumnClassName(2)); assertEquals("java.lang.Long", this.httpResultSetMetadata.getColumnClassName(3)); assertEquals("java.lang.Long", this.httpResultSetMetadata.getColumnClassName(4)); assertEquals("java.lang.Boolean", this.httpResultSetMetadata.getColumnClassName(5)); assertEquals("java.lang.Double", this.httpResultSetMetadata.getColumnClassName(6)); assertEquals("java.lang.Double", this.httpResultSetMetadata.getColumnClassName(7)); assertEquals("java.util.Map", this.httpResultSetMetadata.getColumnClassName(8)); assertEquals("java.sql.Array", this.httpResultSetMetadata.getColumnClassName(9)); }