### Question:
HankakuKanaValidator extends Validator { @Override public void validate(Sentence sentence) { Matcher matcher = pattern.matcher(sentence.getContent()); while (matcher.find()) { addLocalizedError(sentence, sentence.getContent().charAt(matcher.start())); } } HankakuKanaValidator(); @Override List<String> getSupportedLanguages(); @Override void validate(Sentence sentence);  }### Answer:
@Test void testDetectHankakuKana() { Validator validator = new HankakuKanaValidator(); List<ValidationError> errors = new ArrayList<>(); validator.setErrorList(errors); validator.validate(new Sentence("岩の木陰にﾊﾅが咲いている", 0)); assertEquals(2, errors.size()); }
@Test void testRunValidatorWithoutHanakakuKana() { Validator validator = new HankakuKanaValidator(); List<ValidationError> errors = new ArrayList<>(); validator.setErrorList(errors); validator.validate(new Sentence("岩の木陰にハナが咲いている", 0)); assertEquals(0, errors.size()); }
@Test void testRunValidatorWithHankakuSpace() { Validator validator = new HankakuKanaValidator(); List<ValidationError> errors = new ArrayList<>(); validator.setErrorList(errors); validator.validate(new Sentence("岩の木陰に ハナ が咲いている", 0)); assertEquals(0, errors.size()); }