### Question:
SamplingRequest { public Optional<String> getAccountId() { String[] splits = roleArn.split(ARN_SEPARATOR, ACCOUNT_INDEX + 2); if (splits.length < ACCOUNT_INDEX + 2) { return Optional.empty(); } return Optional.of(splits[ACCOUNT_INDEX]); } SamplingRequest(
            String roleArn,
            @Nullable String resourceArn,
            @Nullable String service,
            @Nullable String host,
            @Nullable String method,
            @Nullable String url,
            @Nullable String serviceType,
            @Nullable Map<String, String> attributes
    );  SamplingRequest(
        @Nullable String service,
        @Nullable String host,
        @Nullable String url,
        @Nullable String method,
        @Nullable String serviceType); Optional<String> getAccountId(); String getRoleARN(); Optional<String> getResourceARN(); Optional<String> getService(); Optional<String> getMethod(); Optional<String> getUrl(); Optional<String> getHost(); Optional<String> getServiceType(); Map<String, String> getAttributes(); void setServiceType(String serviceType);  }### Answer:
@Test void testSuccessfulAccountIdParsing() { SamplingRequest req = new SamplingRequest( "arn:aws:iam::123456789123:role/sample-role", null, null, null, null, null, null, null ); Assertions.assertEquals(req.getAccountId().get(), "123456789123"); }