@Override
  public AttributeResource getAttrValue(ResName resName) {
    AttributeResource attributeResource = items.get(resName);

    // This hack allows us to look up attributes from downstream dependencies, see comment in
    // org.robolectric.shadows.ShadowThemeTest.obtainTypedArrayFromDependencyLibrary()
    // for an explanation. TODO(jongerrish): Make Robolectric use a more realistic resource merging
    // scheme.
    if (attributeResource == null
        && !"android".equals(resName.packageName)
        && !"android".equals(packageName)) {
      attributeResource = items.get(resName.withPackageName(packageName));
      if (attributeResource != null && !"android".equals(attributeResource.contextPackageName)) {
        attributeResource =
            new AttributeResource(resName, attributeResource.value, resName.packageName);
      }
    }

    return attributeResource;
  }
@Test
  public void getAttrValue_willReturnTrimmedAttributeValues() throws Exception {
    StyleData styleData =
        new StyleData(
            "library.resource",
            "Theme_MyApp",
            "Theme_Material",
            asList(
                new AttributeResource(myLibSearchViewStyle, "\n lib_value ", "library.resource")));

    assertThat(styleData.getAttrValue(myAppSearchViewStyle).value).isEqualTo("\n lib_value ");
    assertThat(styleData.getAttrValue(myLibSearchViewStyle).trimmedValue).isEqualTo("lib_value");
  }