@Test
public final void testGetSlice() {

  logger.info("--------------------------------------------------------------------------------------------------------------");
  logger.info("Test method getSlice(ColorReferenceSystem)");
  
  // =====================================================
  logger.info("  Test 1.1 : ColorReferenceSystem is null. ");
  ColorimetricColor cResult = new ColorimetricColor();
  assertNull("ColorSlice is not null ", cResult.getSlice(null));
  
  logger.info("  Test 1.2 : ColorReferenceSystem exist but is empty. ");
  cResult = new ColorimetricColor();
  ColorReferenceSystem crsZeroWheels = new ColorReferenceSystem();
  assertNull("ColorSlice is not null ", cResult.getSlice(crsZeroWheels));
  
  logger.info("  Test 1.3 : ColorReferenceSystem without wheels");
  cResult = new ColorimetricColor();
  crsZeroWheels = new ColorReferenceSystem();
  List<ColorWheel> wheels = new ArrayList<ColorWheel>();
  crsZeroWheels.setWheels(wheels);
  assertNull("ColorSlice is not null ", cResult.getSlice(crsZeroWheels));
  
  logger.info("  Test 1.4 : ColorReferenceSystem : each wheels has not got slices");
  List<ColorSlice> slices = new ArrayList<ColorSlice>();
  ColorWheel colorWheel = new ColorWheel();
  colorWheel.setSlices(slices);
  wheels = new ArrayList<ColorWheel>();
  wheels.add(colorWheel);
  cResult = new ColorimetricColor();
  crsZeroWheels = new ColorReferenceSystem();
  crsZeroWheels.setWheels(wheels);
  assertNull("ColorSlice is not null ", cResult.getSlice(crsZeroWheels));
  
  logger.info("  Test 1.5 : ColorReferenceSystem : each slices of each wheels has not got colors");
  ColorSlice colorSlice = new ColorSlice();
  slices = new ArrayList<ColorSlice>();
  slices.add(colorSlice);
  colorWheel = new ColorWheel();
  colorWheel.setSlices(slices);
  wheels = new ArrayList<ColorWheel>();
  wheels.add(colorWheel);
  cResult = new ColorimetricColor();
  crsZeroWheels = new ColorReferenceSystem();
  crsZeroWheels.setWheels(wheels);
  assertNull("ColorSlice is not null ", cResult.getSlice(crsZeroWheels));
  
  // =====================================================
  logger.info("  Test 2 : ColorReferenceSystem with one color");
  colorSlice = new ColorSlice();
  colorSlice.setHue("ROUGE GRIS");
  colorSlice.setIdSaturationParentWheel(0);
  List<ColorimetricColor> justDefaultColorimetricList = new ArrayList<ColorimetricColor>();
  justDefaultColorimetricList.add(new ColorimetricColor());
  colorSlice.setColors(justDefaultColorimetricList);
  
  colorWheel = new ColorWheel();
  slices = new ArrayList<ColorSlice>();
  slices.add(colorSlice);
  colorWheel.setSlices(slices);
  colorWheel.setidSaturation(0);
  
  crsZeroWheels = new ColorReferenceSystem();
  wheels = new ArrayList<ColorWheel>();
  wheels.add(colorWheel);
  crsZeroWheels.setWheels(wheels);
  
  cResult = new ColorimetricColor();
  assertNotNull("ColorSlice is not null ", cResult.getSlice(crsZeroWheels));
  
  // =====================================================
  logger.info("  Test 3 : COGIT ColorReferenceSystem");
  // Loading COGIT Color reference system
  ColorReferenceSystem COGITcrs = ColorReferenceSystem
      .unmarshall(this.getClass().getClassLoader().getResourceAsStream("color/ColorReferenceSystem.xml"));
  
  logger.info("  Test 3.1 : JAUNE");
  
  // Prepare list colors expected for the JAUNE ColorSlice
  List<ColorimetricColor> colorsExpected = new ArrayList<ColorimetricColor>();
  colorsExpected.add(new ColorimetricColor("JAUNE TRES CLAIR"));
  colorsExpected.add(new ColorimetricColor("JAUNE CLAIR"));
  colorsExpected.add(new ColorimetricColor("JAUNE MOYEN CLAIR"));
  colorsExpected.add(new ColorimetricColor("JAUNE PUR"));
  colorsExpected.add(new ColorimetricColor("JAUNE MOYEN FONCE"));
  colorsExpected.add(new ColorimetricColor("JAUNE FONCE"));
  colorsExpected.add(new ColorimetricColor("JAUNE TRES FONCE"));
  
  cResult = COGITcrs.getAllColors().get(1);
  assertEquals("Compare hue. ", "JAUNE", cResult.getSlice(COGITcrs).getHue());
  assertEquals("Compare idSaturationParentWheel. ", 0, cResult.getSlice(COGITcrs).getIdSaturationParentWheel());
  compareColorimetricColorList(colorsExpected, cResult.getSlice(COGITcrs).getColors());
  
  cResult = new ColorimetricColor(1);
  assertEquals("Compare hue. ", "JAUNE", cResult.getSlice(COGITcrs).getHue());
  assertEquals("Compare idSaturationParentWheel. ", 0, cResult.getSlice(COGITcrs).getIdSaturationParentWheel());
  compareColorimetricColorList(colorsExpected, cResult.getSlice(COGITcrs).getColors());
  
  cResult = new ColorimetricColor(2);
  assertEquals("Compare hue. ", "JAUNE", cResult.getSlice(COGITcrs).getHue());
  assertEquals("Compare idSaturationParentWheel. ", 0, cResult.getSlice(COGITcrs).getIdSaturationParentWheel());
  compareColorimetricColorList(colorsExpected, cResult.getSlice(COGITcrs).getColors());
  
  cResult = new ColorimetricColor(7);
  assertEquals("Compare hue. ", "JAUNE", cResult.getSlice(COGITcrs).getHue());
  assertEquals("Compare idSaturationParentWheel. ", 0, cResult.getSlice(COGITcrs).getIdSaturationParentWheel());
  compareColorimetricColorList(colorsExpected, cResult.getSlice(COGITcrs).getColors());
  
  cResult = new ColorimetricColor("JAUNE TRES FONCE");
  assertEquals("Compare hue. ", "JAUNE", cResult.getSlice(COGITcrs).getHue());
  assertEquals("Compare idSaturationParentWheel. ", 0, cResult.getSlice(COGITcrs).getIdSaturationParentWheel());
  compareColorimetricColorList(colorsExpected, cResult.getSlice(COGITcrs).getColors());
  
  // =====================================================
  logger.info("  Test 3.2 : ORANGE GRIS");
  
  // Prepare list colors expected for the ORANGE GRIS ColorSlice
  colorsExpected = new ArrayList<ColorimetricColor>();
  colorsExpected.add(new ColorimetricColor("ORANGE GRIS TRES CLAIR"));
  colorsExpected.add(new ColorimetricColor("ORANGE GRIS MOYEN CLAIR"));
  colorsExpected.add(new ColorimetricColor("ORANGE GRIS MOYEN FONCE"));
  colorsExpected.add(new ColorimetricColor("ORANGE GRIS TRES FONCE"));
  
  cResult = new ColorimetricColor(129);
  assertEquals("", "ORANGE GRIS", cResult.getSlice(COGITcrs).getHue());
  assertEquals("", 1, cResult.getSlice(COGITcrs).getIdSaturationParentWheel());
  
  cResult = new ColorimetricColor(130);
  assertEquals("", "ORANGE GRIS", cResult.getSlice(COGITcrs).getHue());
  assertEquals("", 1, cResult.getSlice(COGITcrs).getIdSaturationParentWheel());
  
  cResult = new ColorimetricColor(131);
  assertEquals("", "ORANGE GRIS", cResult.getSlice(COGITcrs).getHue());
  assertEquals("", 1, cResult.getSlice(COGITcrs).getIdSaturationParentWheel());
  
  cResult = new ColorimetricColor("ORANGE GRIS TRES CLAIR");
  assertEquals("", "ORANGE GRIS", cResult.getSlice(COGITcrs).getHue());
  assertEquals("", 1, cResult.getSlice(COGITcrs).getIdSaturationParentWheel());
  
  // ???
  // List<ColorimetricColor> slice = COGITcrs.getSlice(0, 1);
  
}