// Path: types/src/main/java/com/google/common/html/types/testing/HtmlConversions.java
// public static SafeHtml newSafeHtmlForTest(String string) {
//   return UncheckedConversions.safeHtmlFromStringKnownToSatisfyTypeContract(string);
// }
// 
// Path: types/src/main/java/com/google/common/html/types/testing/HtmlConversions.java
// public static SafeUrl newSafeUrlForTest(String string) {
//   return UncheckedConversions.safeUrlFromStringKnownToSatisfyTypeContract(string);
// }
// 
// Path: types/src/main/java/com/google/common/html/types/testing/assertions/Assertions.java
// public static void assertClassIsNotExportable(Class<?> klass) {
//   for (Class<?> annotation : EXPORTABLE_CLASS_ANNOTATIONS) {
//     if (klass.isAnnotationPresent(annotation.asSubclass(Annotation.class))) {
//       throw new AssertionError(
//           "Class should not have annotation " + annotation.getName()
//           + ", @CompileTimeConstant can be bypassed: " + klass);
//     }
//   }
// }


import static com.google.common.html.types.testing.HtmlConversions.newSafeHtmlForTest;
import static com.google.common.html.types.testing.HtmlConversions.newSafeUrlForTest;
import static com.google.common.html.types.testing.assertions.Assertions.assertClassIsNotExportable;
import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
import java.util.ArrayList;
import junit.framework.TestCase;
      fail("Data attribute shouldn't allow setting arbitrary attributes.");
    } catch (IllegalArgumentException expected) {
    }
  }

  public void testAllowsResourceUrlInLinkedStylesheet() {
    TrustedResourceUrl url = TrustedResourceUrls.fromConstant("a");
    assertSameHtml(
        "<link rel=\"stylesheet\" href=\"a\">",
        new SafeHtmlBuilder("link").setRel("stylesheet").setHref(url));

    assertSameHtml(
        "<link href=\"a\" rel=\"stylesheet\">",
        new SafeHtmlBuilder("link").setHref(url).setRel("stylesheet"));
  }

  public void testAllowsResourceUrlInLinkedDangerousContexts() {
    TrustedResourceUrl url = TrustedResourceUrls.fromConstant("a");
    assertSameHtml(
        "<link rel=\"serviceworker\" href=\"a\">",
        new SafeHtmlBuilder("link").setRel("serviceworker").setHref(url));

    assertSameHtml(
        "<link rel=\"import\" href=\"a\">",
        new SafeHtmlBuilder("link").setRel("next").setHref(url).setRel("import"));
  }

  public void testAllowsSafeUrlInLinkedIcon() {
    assertSameHtml("<link rel=\"icon\" href=\"a\">", new SafeHtmlBuilder("link")
        .setRel("icon")
// Path: types/src/main/java/com/google/common/html/types/testing/HtmlConversions.java
// public static SafeHtml newSafeHtmlForTest(String string) {
//   return UncheckedConversions.safeHtmlFromStringKnownToSatisfyTypeContract(string);
// }
// 
// Path: types/src/main/java/com/google/common/html/types/testing/HtmlConversions.java
// public static SafeUrl newSafeUrlForTest(String string) {
//   return UncheckedConversions.safeUrlFromStringKnownToSatisfyTypeContract(string);
// }
// 
// Path: types/src/main/java/com/google/common/html/types/testing/assertions/Assertions.java
// public static void assertClassIsNotExportable(Class<?> klass) {
//   for (Class<?> annotation : EXPORTABLE_CLASS_ANNOTATIONS) {
//     if (klass.isAnnotationPresent(annotation.asSubclass(Annotation.class))) {
//       throw new AssertionError(
//           "Class should not have annotation " + annotation.getName()
//           + ", @CompileTimeConstant can be bypassed: " + klass);
//     }
//   }
// }


// Path: types/src/test/java/com/google/common/html/types/SafeHtmlBuilderTest.java
import static com.google.common.html.types.testing.HtmlConversions.newSafeHtmlForTest;
import static com.google.common.html.types.testing.HtmlConversions.newSafeUrlForTest;
import static com.google.common.html.types.testing.assertions.Assertions.assertClassIsNotExportable;
import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
import java.util.ArrayList;
import junit.framework.TestCase;

      fail("Data attribute shouldn't allow setting arbitrary attributes.");
    } catch (IllegalArgumentException expected) {
    }
  }

  public void testAllowsResourceUrlInLinkedStylesheet() {
    TrustedResourceUrl url = TrustedResourceUrls.fromConstant("a");
    assertSameHtml(
        "<link rel=\"stylesheet\" href=\"a\">",
        new SafeHtmlBuilder("link").setRel("stylesheet").setHref(url));

    assertSameHtml(
        "<link href=\"a\" rel=\"stylesheet\">",
        new SafeHtmlBuilder("link").setHref(url).setRel("stylesheet"));
  }

  public void testAllowsResourceUrlInLinkedDangerousContexts() {
    TrustedResourceUrl url = TrustedResourceUrls.fromConstant("a");
    assertSameHtml(
        "<link rel=\"serviceworker\" href=\"a\">",
        new SafeHtmlBuilder("link").setRel("serviceworker").setHref(url));

    assertSameHtml(
        "<link rel=\"import\" href=\"a\">",
        new SafeHtmlBuilder("link").setRel("next").setHref(url).setRel("import"));
  }

  public void testAllowsSafeUrlInLinkedIcon() {
    assertSameHtml("<link rel=\"icon\" href=\"a\">", new SafeHtmlBuilder("link")
        .setRel("icon")
        .setHref(newSafeUrlForTest("a")));