class Size {

    public static Size parse(String providedLongWithUnitString) throws Exception {
        if (providedLongWithUnitString.equalsIgnoreCase(UNKNOWN)) {
            return new Size(Unit.NoUnit, UNKNOWN_VALUE);
        }
        if (providedLongWithUnitString.equalsIgnoreCase(UNLIMITED)) {
            return new Size(Unit.NoUnit, UNLIMITED_VALUE);
        }
        char lastChar = providedLongWithUnitString.charAt(providedLongWithUnitString.length() - 1);
        Unit unit = getUnit(lastChar);
        String argWithoutUnit = removeLastCharIfNeeded(providedLongWithUnitString, unit);
        return new Size(unit, Long.parseLong(argWithoutUnit));
    }

    private  Size(Unit unit, Long value);

}