// TODO: move tests to a unittest
public static void main (String[] args) {
List<Weight> intervals = new ArrayList<Weight>();
intervals.add(new Weight(
new DateTime(2012, 8, 4, 8, 0, 0),
new DateTime(2012, 8, 4, 10, 0, 0),
new Double(1)));
intervals.add(new Weight(
new DateTime(2012, 8, 4, 12, 0, 0),
new DateTime(2012, 8, 4, 14, 0, 0),
new Double(1)));
intervals.add(new Weight(
new DateTime(2012, 8, 4, 13, 0, 0),
new DateTime(2012, 8, 4, 16, 0, 0),
new Double(1)));
intervals.add(new Weight(
new DateTime(2012, 8, 4, 3, 0, 0),
new DateTime(2012, 8, 4, 4, 0, 0),
new Double(1)));
intervals.add(new Weight(
new DateTime(2012, 8, 4, 3, 0, 0),
new DateTime(2012, 8, 4, 4, 0, 0),
new Double(1)));
intervals.add(new Weight(
new DateTime(2012, 8, 4, 3, 0, 0),
new DateTime(2012, 8, 4, 5, 0, 0),
new Double(1)));
intervals.add(new Weight(
new DateTime(2012, 8, 4, 17, 30, 0),
new DateTime(2012, 8, 4, 18, 0, 0),
new Double(1.5)));
intervals.add(new Weight(
new DateTime(2012, 8, 4, 17, 0, 0),
new DateTime(2012, 8, 4, 17, 30, 0),
new Double(1.5)));
List<Weight> merged = WeightsUtil.merge(intervals);