### Question:
NullValidator { public static void validateNull(JsonObject inputObject, String value) throws ValidatorException { if (value != null && !(value.equals("null") || value.equals("\"null\""))) { throw new ValidatorException("Expected a null but found a value. " + "Received not null input" + value + " to be validated with : " + inputObject .toString()); } } private  NullValidator(); static void validateNull(JsonObject inputObject, String value);  }### Answer:
@Test public void testNullStringInput() throws ValidatorException { String schema = "{\"type\":\"null\"}"; String testPayload = "null"; JsonObject schemaObject = (JsonObject) parser.parse(schema); NullValidator.validateNull(schemaObject, testPayload); }
@Test public void testEmptyInput() throws ValidatorException { thrown.expect(ValidatorException.class); String schema = "{\"type\":\"null\"}"; String testPayload = ""; JsonObject schemaObject = (JsonObject) parser.parse(schema); NullValidator.validateNull(schemaObject, testPayload); }
@Test public void testNullInput() throws ValidatorException { String schema = "{\"type\":\"null\"}"; JsonObject schemaObject = (JsonObject) parser.parse(schema); NullValidator.validateNull(schemaObject, null); }
@Test public void testInvalidNullInput() throws ValidatorException { thrown.expect(ValidatorException.class); String schema = "{\"type\":\"null\"}"; String testPayload = "Banana"; JsonObject schemaObject = (JsonObject) parser.parse(schema); NullValidator.validateNull(schemaObject, testPayload); }