@SuppressWarnings({

		"unchecked", "rawtypes"
})
@Test
public void testSecondsToHours() {
	String symbol = "ESZ13";
	Instrument instr = TestHarness.makeInstrument(symbol);
	DateTime dt2 = new DateTime(2013, 12, 10, 0, 0, 0);
	TimeFrameImpl tf2 = new TimeFrameImpl(new Period(PeriodType.HOUR, 3), dt2, null);
	SeriesSubscription sub2 = new SeriesSubscription(
		"ESZ13", instr, "IO", new TimeFrameImpl[] { tf2 }, TradingWeekImpl.DEFAULT);
	BarBuilder barBuilder = new BarBuilder(sub2);
	barBuilder.addInputTimeSeries(BarBuilder.INPUT_KEY, new DataSeriesImpl<BarImpl>(
			new Period(PeriodType.SECOND, 1)));
	DataSeriesImpl<BarImpl> inputSeries =
			(DataSeriesImpl) barBuilder.getInputTimeSeries(BarBuilder.INPUT_KEY);
	assertNotNull(inputSeries);
	barBuilder.addOutputTimeSeries(BarBuilder.OUTPUT_KEY, new DataSeriesImpl<BarImpl>(
		new Period(PeriodType.HOUR, 3)));
	DataSeriesImpl<BarImpl> outputSeries =
		(DataSeriesImpl) barBuilder.getOutputTimeSeries(BarBuilder.OUTPUT_KEY);
	assertNotNull(outputSeries);
	assertEquals(new Period(PeriodType.HOUR, 3), outputSeries.getPeriod());
	List<BarImpl> list = getBars5();
	System.out.println("got " + list.size() + " bars");
	SpanImpl span = new SpanImpl(new Period(PeriodType.SECOND, 1),
		new DateTime(2013, 12, 10, 0, 0, 0),
			new DateTime(2013, 12, 10, 0, 0, 0));
	for (int i = 0; i < list.size(); i++) {
		inputSeries.add(list.get(i));
	}
	System.out.println("added " + list.size() + " bars to inputSeries");
	span.setNextDate(inputSeries.get(inputSeries.size() - 1).getDate());
	System.out.println("setNextDate to: " + inputSeries.get(inputSeries.size() - 1).getDate() + " --> " + span);
	System.out.println("calling process...");
	Span resultSpan = barBuilder.process(span);
	System.out.println("resultSpan = " + resultSpan);
	System.out.println("outputSeries size = " + outputSeries.size());
	System.out.println("process finished...");
	assertEquals(2, outputSeries.size());
	list = getBars6();
	for (BarImpl db : list) {
		inputSeries.add(db);
		span.setDate(db.getDate());
		span.setNextDate(db.getDate());
		barBuilder.process(span);
	}
	assertEquals(5, outputSeries.size());
	for (int i = 0; i < outputSeries.size(); i++) {
		System.out.println(outputSeries.get(i));
	}
	System.out.println("output series size: " + outputSeries.size());
}