DisplayFormat { public static Pair<String, String> detailedCob(final RawDisplayData raw) { SmallestDoubleString cobMini = new SmallestDoubleString(raw.sCOB2, SmallestDoubleString.Units.USE); String cob2 = ""; if (cobMini.getExtra().length() > 0) { cob2 = cobMini.getExtra() + cobMini.getUnits(); } final String cob1 = cobMini.minimise(MAX_FIELD_LEN_SHORT); return Pair.create(cob1, cob2); }  static String deltaSymbol(); static String verticalSeparatorSymbol(); static String basalRateSymbol(); static String shortTimeSince(final long refTime); static String shortTrend(final RawDisplayData raw); static String longGlucoseLine(final RawDisplayData raw); static String longDetailsLine(final RawDisplayData raw); static Pair<String, String> detailedIob(RawDisplayData raw); static Pair<String, String> detailedCob(final RawDisplayData raw); static final int MAX_FIELD_LEN_LONG; static final int MAX_FIELD_LEN_SHORT; static final int MIN_FIELD_LEN_COB; static final int MIN_FIELD_LEN_IOB; }
@Test public void detailedCobTest() { assertThat(DisplayFormat.detailedCob(rawCob("0g")), is(Pair.create("0g", ""))); assertThat(DisplayFormat.detailedCob(rawCob("50g")), is(Pair.create("50g", ""))); assertThat(DisplayFormat.detailedCob(rawCob("2(40)g")), is(Pair.create("2g", "40g"))); assertThat(DisplayFormat.detailedCob(rawCob("0(24)g")), is(Pair.create("0g", "24g"))); assertThat(DisplayFormat.detailedCob(rawCob("13(5)g")), is(Pair.create("13g", "5g"))); assertThat(DisplayFormat.detailedCob(rawCob("11(50)g")), is(Pair.create("11g", "50g"))); assertThat(DisplayFormat.detailedCob(rawCob("19(38)g")), is(Pair.create("19g", "38g"))); assertThat(DisplayFormat.detailedCob(rawCob("100(1)g")), is(Pair.create("100g", "1g"))); }