Iob { public Iob plus(Iob iob) { iobContrib += iob.iobContrib; activityContrib += iob.activityContrib; return this; }  Iob iobContrib(double iobContrib); Iob activityContrib(double activityContrib); Iob plus(Iob iob); @Override boolean equals(Object o); @Override int hashCode(); public double iobContrib; public double activityContrib; }
@Test public void plusTest() { Iob a = new Iob().iobContrib(1).activityContrib(2); Iob b = new Iob().iobContrib(3).activityContrib(4); a.plus(b); Assert.assertEquals(4d, a.iobContrib, 0.01d); Assert.assertEquals(6d, a.activityContrib, 0.01d); }