@Test
 public void testbuildBarDataSizeString_Days() {
   assertEquals("1 day", HistoricalDataUtils.buildBarDataSizeString(1, LengthUnit.DAY));
   try {
     HistoricalDataUtils.buildBarDataSizeString(2, LengthUnit.DAY);
     fail();
   } catch (InvalidBarSizeException ex) {
     // this should happen
   }
 }
 @Test
 public void testbuildBarDataSizeString_Seconds() {
   assertEquals("1 sec", HistoricalDataUtils.buildBarDataSizeString(1, LengthUnit.SECOND));
   assertEquals("5 secs", HistoricalDataUtils.buildBarDataSizeString(5, LengthUnit.SECOND));
   assertEquals("15 secs", HistoricalDataUtils.buildBarDataSizeString(15, LengthUnit.SECOND));
   assertEquals("30 secs", HistoricalDataUtils.buildBarDataSizeString(30, LengthUnit.SECOND));
   try {
     HistoricalDataUtils.buildBarDataSizeString(31, LengthUnit.SECOND);
     fail();
   } catch (InvalidBarSizeException ex) {
     // this should happen
   }
 }
 @Test
 public void testBuildBarDataSizeString_InvalidSize() {
   try {
     HistoricalDataUtils.buildBarDataSizeString(1, LengthUnit.WEEK);
     fail();
   } catch (InvalidBarSizeException ex) {
     // this should happen
   }
 }
 @Test
 public void testbuildBarDataSizeString_Minutes() {
   assertEquals("1 min", HistoricalDataUtils.buildBarDataSizeString(1, LengthUnit.MINUTE));
   assertEquals("2 mins", HistoricalDataUtils.buildBarDataSizeString(2, LengthUnit.MINUTE));
   assertEquals("5 mins", HistoricalDataUtils.buildBarDataSizeString(5, LengthUnit.MINUTE));
   assertEquals("15 mins", HistoricalDataUtils.buildBarDataSizeString(15, LengthUnit.MINUTE));
   assertEquals("30 mins", HistoricalDataUtils.buildBarDataSizeString(30, LengthUnit.MINUTE));
   try {
     HistoricalDataUtils.buildBarDataSizeString(31, LengthUnit.MINUTE);
     fail();
   } catch (InvalidBarSizeException ex) {
     // this should happen
   }
 }