public static Duration parse(final String text) {
    try {
      final String[] parts = text.split("\\s");
      if (parts.length != 2) {
        throw new IllegalArgumentException("Expected 2 tokens, got: " + parts.length);
      }

      final long size = parseNumeric(parts[0]);
      return buildDuration(size, parts[1]);
    } catch (final Exception e) {
      throw new IllegalArgumentException("Invalid duration: '" + text + "'. " + e.getMessage(), e);
    }
  }
@Test
  public void shouldThrowOnUnknownTimeUnit() {
    // Then:
    // When:
    final Exception e = assertThrows(
        IllegalArgumentException.class,
        () -> parse("10 Green_Bottles")
    );

    // Then:
    assertThat(e.getMessage(), containsString("Unknown time unit: 'GREEN_BOTTLES'"));
  }