@Test public void testGetMaxKeyBasedOnDimensions() {

 List<QueryDimension> dimensions = new ArrayList<QueryDimension>();
   for (int i = 0; i < 2; i++) {
     QueryDimension dimension = new QueryDimension(segmentProperties.getDimensions().get(i).getColName());
     dimension.setDimension(segmentProperties.getDimensions().get(i));
     dimensions.add(dimension);
   }
  byte[] maxKeyBasedOnDimensions = null;
  try {
    maxKeyBasedOnDimensions = QueryUtil
        .getMaxKeyBasedOnDimensions(dimensions, segmentProperties.getDimensionKeyGenerator());
  } catch (KeyGenException e) {
    assertTrue(false);
  }
  byte[] expectedMaxKeyBasedOnDimensions = { -1, 0, 0, 0, 0, 0 };
  for (int i = 0; i < expectedMaxKeyBasedOnDimensions.length; i++) {
    if (expectedMaxKeyBasedOnDimensions[i] != maxKeyBasedOnDimensions[i]) {
      assertTrue(false);
    }
  }
  long[] expectedKeyArray = { 255, 0, 0, 0, 0, 0 };
  long[] keyArray =
      segmentProperties.getDimensionKeyGenerator().getKeyArray(maxKeyBasedOnDimensions);
  for (int i = 0; i < keyArray.length; i++) {
    if (expectedKeyArray[i] != keyArray[i]) {
      assertTrue(false);
    }
  }
}