AbstractNeo4JOperation implements Neo4JOperation { protected void executeQuery(final Connection connection, final String query) throws SQLException { try (PreparedStatement ps = connection.prepareStatement(query)) { try (ResultSet rs = ps.executeQuery()) { } } }    }
@Test public void testExecuteQuery() throws SQLException { final String query = "some query"; operation.executeQuery(connection, query); final InOrder order = inOrder(connection, ps, rs); order.verify(connection).prepareStatement(eq(query)); order.verify(ps).executeQuery(); order.verify(rs).close(); order.verify(ps).close(); }