class TimeResolver {

    public static Long resolveExpression(String subject) {
      Matcher m = expiryPattern.matcher(subject);
      if (m.find()) {
        String key = m.group(2);
        if (key.equals("")) key = defaultUnit;
        return Long.parseLong(m.group(1), 10) * timeMultipliers.get(key);
      }
      return -1L;
    }

}