package com.google.step.snippet;

import com.google.step.snippet.data.Card;
import com.google.step.snippet.external.W3SchoolClient;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

@RunWith(JUnit4.class)
public final class W3SchoolClientTest {

  W3SchoolClient client = new W3SchoolClient();

  @Test
  public void htmlImage() {
    Card actual = client.search("https://www.w3schools.com/tags/tag_img.asp");
    Card expected =
        new Card(
            "HTML <img> Tag",
            "<img src=\"img_girl.jpg\" alt=\"Girl in a jacket\" width=\"500\" height=\"600\">",
            "https://www.w3schools.com/tags/tag_img.asp",
            "How to insert an image:");
    Assert.assertTrue(actual.equals(expected));
  }

  @Test
  public void jsJson() {
    Card actual = client.search("https://www.w3schools.com/js/js_json_intro.asp");
    Card expected =
        new Card(
            "JSON - Introduction",
            "var myObj = {name: \"John\", age: 31, city: \"New York\"}; var myJSON ="
                + " JSON.stringify(myObj); window.location = \"demo_json.php?x=\" + myJSON;",
            "https://www.w3schools.com/js/js_json_intro.asp",
            "JSON: JavaScript Object Notation.");
    Assert.assertTrue(actual.equals(expected));
  }

  @Test
  public void incompleteCard() {
    Card actual = client.search("https://www.w3schools.com/html/html_quiz.asp");
    Card expected = null;
    Assert.assertEquals(actual, expected);
  }

  @Test
  public void invalidLink() {
    Card actual = client.search("https://www.w3schools.com/css/html.asp");
    Card expected = null;
    Assert.assertEquals(actual, expected);
  }

  @Test
  public void blankPage() {
    Card actual = client.search("https://www.w3schools.com/");
    Card expected = null;
    Assert.assertEquals(actual, expected);
  }
}

@@ -27,16 +27,105 @@
 ippet;%0A%0A
+import static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertNull;%0A%0A
 import c
@@ -158,16 +158,16 @@
 a.Card;%0A
-
 import c
@@ -218,33 +218,8 @@
 nt;%0A
-import org.junit.Assert;%0A
 impo
@@ -370,16 +370,30 @@
 st %7B%0A%0A  
+private final 
 W3School
@@ -816,40 +816,29 @@
     
-Assert.assertTrue(actual.equals(
+assertEquals(actual, 
 expe
@@ -834,33 +834,32 @@
 ctual, expected)
-)
 ;%0A  %7D%0A%0A  @Test%0A 
@@ -1338,40 +1338,29 @@
     
-Assert.assertTrue(actual.equals(
+assertEquals(actual, 
 expe
@@ -1364,17 +1364,16 @@
 xpected)
-)
 ;%0A  %7D%0A%0A 
@@ -1501,70 +1501,25 @@
     
-Card expected = null;%0A    Assert.assertEquals(actual, expected
+assertNull(actual
 );%0A 
@@ -1643,70 +1643,25 @@
     
-Card expected = null;%0A    Assert.assertEquals(actual, expected
+assertNull(actual
 );%0A 
@@ -1771,70 +1771,25 @@
     
-Card expected = null;%0A    Assert.assertEquals(actual, expected
+assertNull(actual
 );%0A 

Add static imports