@Test
public void shouldParseUnitFromPattern() {

    assertThat(UnitUtils.parseUnit("%.2f °F"), is(ImperialUnits.FAHRENHEIT));
    assertThat(UnitUtils.parseUnit("%.2f °C"), is(SIUnits.CELSIUS));
    assertThat(UnitUtils.parseUnit("myLabel km"), is(KILO(SIUnits.METRE)));
    assertThat(UnitUtils.parseUnit("%.2f %%"), is(SmartHomeUnits.PERCENT));
    assertThat(UnitUtils.parseUnit("myLabel %unit%"), is(nullValue()));
    assertThat(UnitUtils.parseUnit("%.2f kvarh"), is(SmartHomeUnits.KILOVAR_HOUR));
}