BgReading implements DataPointWithLabelInterface { public boolean isEqual(BgReading other) { if (date != other.date) { if (L.isEnabled(L.GLUCOSE)) log.error("Comparing different"); return false; } if (value != other.value) return false; if (raw != other.raw) return false; if (!Objects.equals(direction, other.direction)) return false; if (!Objects.equals(_id, other._id)) return false; return true; } BgReading();  BgReading(NSSgv sgv); Double valueToUnits(String units); String valueToUnitsToString(String units); String directionToSymbol(); @Override String toString(); boolean isDataChanging(BgReading other); boolean isEqual(BgReading other); void copyFrom(BgReading other); BgReading date(long date); BgReading date(Date date); BgReading value(double value); @Override double getX(); @Override double getY(); @Override void setY(double y); @Override String getLabel(); @Override long getDuration(); @Override PointsWithLabelGraphSeries.Shape getShape(); @Override float getSize(); @Override int getColor(); int getPredectionColor(); @DatabaseField(id = true)
    public long date; @DatabaseField
    public boolean isValid; @DatabaseField
    public double value; @DatabaseField
    public String direction; @DatabaseField
    public double raw; @DatabaseField
    public int source; @DatabaseField
    public String _id; public boolean isCOBPrediction; public boolean isaCOBPrediction; public boolean isIOBPrediction; public boolean isUAMPrediction; public boolean isZTPrediction; }
@Test public void isEqualTest() { bgReading = new BgReading(); BgReading copy = new BgReading(); bgReading.value = 81; long now = System.currentTimeMillis(); bgReading.date = now; copy.date = now; copy.copyFrom(bgReading); assertTrue(copy.isEqual(bgReading)); assertFalse(copy.isEqual(new BgReading())); }