// 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/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.assertions.Assertions.assertClassIsNotExportable;
import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
import java.util.ArrayList;
import java.util.List;
import junit.framework.TestCase;
  public void testFromStyleSheet() {
    SafeHtml html = SafeHtmls.fromStyleSheet(SafeStyleSheets.fromConstant(
        ".title { color: #000000; };"));
    assertEquals(
        "<style type=\"text/css\">.title { color: #000000; };</style>",
        html.getSafeHtmlString());
  }

  public void testFromStyleSheetIllegal() {
    SafeStyleSheet unsafeStyle =
        UncheckedConversions.safeStyleSheetFromStringKnownToSatisfyTypeContract(
            ".title { color: #000000; };</style><script>alert('malicious script');</script>");
    try {
      SafeHtmls.fromStyleSheet(unsafeStyle);
      fail("Should throw an AssertionError if style contains \"<\" or \">\"");
    } catch (IllegalArgumentException e) {
      assertNotNull(e);
    }
  }

  public void testFromStyleUrl() {
    SafeHtml html = SafeHtmls.fromStyleUrl(
        TrustedResourceUrls.fromConstant("https://example.com/&<\"'style.css"));
    assertEquals("<style type=\"text/css\" "
        + "src=\"https://example.com/&amp;&lt;&quot;&#39;style.css\"></style>",
        html.getSafeHtmlString());
  }

  public void testToAndFromProto() {
    String html = "<b>Hello World</b>";
// 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/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/SafeHtmlsTest.java
import static com.google.common.html.types.testing.HtmlConversions.newSafeHtmlForTest;
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 java.util.List;
import junit.framework.TestCase;

  public void testFromStyleSheet() {
    SafeHtml html = SafeHtmls.fromStyleSheet(SafeStyleSheets.fromConstant(
        ".title { color: #000000; };"));
    assertEquals(
        "<style type=\"text/css\">.title { color: #000000; };</style>",
        html.getSafeHtmlString());
  }

  public void testFromStyleSheetIllegal() {
    SafeStyleSheet unsafeStyle =
        UncheckedConversions.safeStyleSheetFromStringKnownToSatisfyTypeContract(
            ".title { color: #000000; };</style><script>alert('malicious script');</script>");
    try {
      SafeHtmls.fromStyleSheet(unsafeStyle);
      fail("Should throw an AssertionError if style contains \"<\" or \">\"");
    } catch (IllegalArgumentException e) {
      assertNotNull(e);
    }
  }

  public void testFromStyleUrl() {
    SafeHtml html = SafeHtmls.fromStyleUrl(
        TrustedResourceUrls.fromConstant("https://example.com/&<\"'style.css"));
    assertEquals("<style type=\"text/css\" "
        + "src=\"https://example.com/&amp;&lt;&quot;&#39;style.css\"></style>",
        html.getSafeHtmlString());
  }

  public void testToAndFromProto() {
    String html = "<b>Hello World</b>";
    SafeHtml safeHtml = newSafeHtmlForTest(html);