public void testGetAttribute() throws Exception {
    RawAttributeMapper rawMapper = RawAttributeMapper.of(setupGenRule());
    List<Label> value = rawMapper.get("data", BuildType.LABEL_LIST);
    assertNotNull(value);
    assertThat(value).containsExactly(Label.create("x", "data_a"), Label.create("x", "data_b"));

    // Configurable attribute: trying to directly access from a RawAttributeMapper throws a
    // type mismatch exception.
    try {
      rawMapper.get("srcs", BuildType.LABEL_LIST);
      fail("Expected srcs lookup to fail since the returned type is a SelectorList and not a list");
    } catch (IllegalArgumentException e) {
      assertThat(e.getCause().getMessage())
          .contains("SelectorList cannot be cast to java.util.List");
    }
  }