@Nonnull
  public static ArnResource accessPointFromArn(String arn) throws IllegalArgumentException {
    Arn parsed = Arn.fromString(arn);

    if (!parsed.region().isPresent() || !parsed.accountId().isPresent() ||
        parsed.resourceAsString().isEmpty()) {
      throw new IllegalArgumentException(
          String.format("Access Point Arn %s has an invalid format or missing properties", arn));
    }

    String resourceName = parsed.resource().resource();
    return new ArnResource(resourceName, parsed.accountId().get(), parsed.region().get(),
        parsed.partition(), arn);
  }
@Test
  public void invalidARNsMustThrow() throws Exception {
    describe("Using an invalid ARN format must throw when initializing an ArnResource.");

    intercept(IllegalArgumentException.class, () ->
        ArnResource.accessPointFromArn("invalid:arn:resource"));
  }