  @Test public void testScaling() throws Exception
  {

    ScaleCategory category1 = new ScaleCategory("Category 1", 0, 49, "CAT1", 1);
    ScaleCategory category2 = new ScaleCategory("Category 2", 50, 99, "CAT2", 2);

    Set<ScaleCategory> categories = new HashSet<ScaleCategory>();
    categories.add(category1);
    categories.add(category2);

    CategoricalScale scale = new CategoricalScale(categories);


    ScaleCategory scaledCategory = scale.scaleRawValue(49);

    Assert.assertEquals(category1, scaledCategory);


    scaledCategory = scale.scaleRawValue(50);

    Assert.assertEquals(category2, scaledCategory);


    scaledCategory = scale.scaleRawValue(99);

    Assert.assertEquals(category2, scaledCategory);
  }