// 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;
    } catch (IllegalArgumentException expected) {
    }
  }

  public void testSettingAttributeAgainIsAllowed() {
    assertSameHtml(
        "<a title=\"c\"></a>",
        new SafeHtmlBuilder("a").setTitle("a").setTitle("c"));
  }

  public void testDisallowsUsingNullValues() {
    try {
      new SafeHtmlBuilder("a").setTitle(null);
      fail("The null attribute value shouldn't be allowed.");
    } catch (NullPointerException expected) {
    }
  }

  public void testDisallowsSafeUrlInIframeSrcAttribute() {
    try {
      new SafeHtmlBuilder("iframe").setSrc(newSafeUrlForTest("b"));
      fail("<iframe src> should require TrustedResourceUrl.");
    } catch (IllegalArgumentException expected) {
    }
  }

  public void testAllowsSafeHtmlInIframeSrcdocAttribute() {
    assertSameHtml(
        "<iframe srcdoc=\"&lt;a href=&quot;https://www.foo.com&quot;&gt;foo&lt;/a&gt;\"></iframe>",
        new SafeHtmlBuilder("iframe")
// 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;

    } catch (IllegalArgumentException expected) {
    }
  }

  public void testSettingAttributeAgainIsAllowed() {
    assertSameHtml(
        "<a title=\"c\"></a>",
        new SafeHtmlBuilder("a").setTitle("a").setTitle("c"));
  }

  public void testDisallowsUsingNullValues() {
    try {
      new SafeHtmlBuilder("a").setTitle(null);
      fail("The null attribute value shouldn't be allowed.");
    } catch (NullPointerException expected) {
    }
  }

  public void testDisallowsSafeUrlInIframeSrcAttribute() {
    try {
      new SafeHtmlBuilder("iframe").setSrc(newSafeUrlForTest("b"));
      fail("<iframe src> should require TrustedResourceUrl.");
    } catch (IllegalArgumentException expected) {
    }
  }

  public void testAllowsSafeHtmlInIframeSrcdocAttribute() {
    assertSameHtml(
        "<iframe srcdoc=\"&lt;a href=&quot;https://www.foo.com&quot;&gt;foo&lt;/a&gt;\"></iframe>",
        new SafeHtmlBuilder("iframe")
            .setSrcdoc(newSafeHtmlForTest("<a href=\"https://www.foo.com\">foo</a>")));