DetailedBolusInfo { public DetailedBolusInfo copy() { DetailedBolusInfo n = new DetailedBolusInfo(); n.date = date; n.eventType = eventType; n.insulin = insulin; n.carbs = carbs; n.source = source; n.isValid = isValid; n.glucose = glucose; n.glucoseType = glucoseType; n.carbTime = carbTime; n.boluscalc = boluscalc; n.context = context; n.pumpId = pumpId; n.isSMB = isSMB; n.deliverAt = deliverAt; n.notes = notes; return n; }  DetailedBolusInfo copy(); @Override String toString(); public long date; public long lastKnownBolusTime; public String eventType; public double insulin; public double carbs; public int source; public boolean isValid; public double glucose; public String glucoseType; public int carbTime; public JSONObject boluscalc; public Context context; public long pumpId; public boolean isSMB; public long deliverAt; public String notes; }
@Test public void copyShouldCopyAllProperties() { DetailedBolusInfo d1 = new DetailedBolusInfo(); d1.deliverAt = 123; DetailedBolusInfo d2 = d1.copy(); Assert.assertEquals(true, EqualsBuilder.reflectionEquals(d2, d1)); }