docs: public static MemorySize parse(String value, MemoryUnit defaultUnit) {
          if (value == null || value.length() == 0) {
              return new MemorySize(0, MemoryUnit.BYTES);
          }
  
          MemoryUnit unit = defaultUnit;
          final char last = value.charAt(value.length() - 1);
          if (!Character.isDigit(last)) {
              value = value.substring(0, value.length() - 1);
              switch (last) {
                  case 'g':
                  case 'G':
                      unit = MemoryUnit.GIGABYTES;
                      break;
  
                  case 'm':
                  case 'M':
                      unit = MemoryUnit.MEGABYTES;
                      break;
  
                  case 'k':
                  case 'K':
                      unit = MemoryUnit.KILOBYTES;
                      break;
  
                  default:
                      throw new IllegalArgumentException("Could not determine memory unit of " + value + last);
              }
          }
  
          return new MemorySize(Long.parseLong(value), unit);
      }