class DistinctQueryResult implements QueryResult {

    @Override
    public String getColumnLabel(final int columnIndex) throws SQLException {
        String columnLabel = queryResultMetaData.getColumnLabel(columnIndex);
        if (null != columnLabel) {
            return columnLabel;
        }
        throw new SQLException("Column index out of range", "9999");
    }

}

class DistinctQueryResultTest {

    private DistinctQueryResult distinctQueryResult;
    private QueryResultMetaData queryResultMetaData;

    @Test(expected = SQLException.class)
    public void assertGetColumnLabelWithException() throws SQLException {

        assertThat(distinctQueryResult.getColumnLabel(2), is("order_id"));
    }

}