    @Test
    public void testCreateGroupByElement() throws Exception {

        final DimensionTable dimensionTable = new DimensionTable("testDimension", "testDimensionName");
        dimensionTable.addTableColumn("testColumn", ColumnDataType.STRING, "TESTINFONAME");
        dimensionTable.addTableColumn("testColumn2", ColumnDataType.STRING, "TESTINFONAME2");
        final SelectElement selectElement = new SelectElement(queryBuilderAccess);
        new Expectations(selectElement) {
            {
                queryBuilderAccess.getQueryParameter();
                result = queryParameter;

                queryParameter.getGroups();
                result = Lists.newArrayList(Pair.of("TESTDIMENSIONNAME", "TESTINFONAME"), Pair.of("TESTDIMENSIONNAME", "TESTINFONAME2"));
                queryBuilderAccess.getStarSchemaConfig();
                result = starSchemaConfig;
                queryParameter.getGroups();
                result = Lists.newArrayList(Pair.of("TESTDIMENSIONNAME", "TESTINFONAME"), Pair.of("TESTDIMENSIONNAME", "TESTINFONAME2"));

                queryParameter.getTimezoneName();
                result = "UTC";

                starSchemaConfig.getDimensionByName("TESTDIMENSIONNAME", "UTC");
                result = dimensionTable;
                queryParameter.getTimezoneName();
                result = "UTC";
                starSchemaConfig.getDimensionByName("TESTDIMENSIONNAME", "UTC");
                result = dimensionTable;
            }
        };

        Optional<GroupByElement> groupByElement = GroupByElement.createGroupByElement(queryBuilderAccess);
        assertTrue(groupByElement.isPresent());
        assertEquals(groupByElement.get().getSqlTables().size(), 1);
        assertEquals(groupByElement.get().getSqlString().toString(), "testDimension.testColumn, testDimension.testColumn2");

    }