BgReading implements DataPointWithLabelInterface { public Double valueToUnits(String units) { if (units.equals(Constants.MGDL)) return value; else return value * Constants.MGDL_TO_MMOLL; } 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 valueToUnits() { bgReading.value = 18; assertEquals(18, bgReading.valueToUnits(Constants.MGDL) * 1, 0.01d); assertEquals(1, bgReading.valueToUnits(Constants.MMOL) * 1, 0.01d); }