Mrz { public boolean valid() { try { if (mrz.startsWith("P")) { return checkPassportMRZ(mrz); } else if (mrz.startsWith("I")){ return checkIDMRZ(mrz); } } catch (Exception ignored) { } return false; } Mrz(String mrz); DocumentData getPrettyData(); boolean valid(); String getText();  }
@Test public void valid_passport_mrz() throws Exception { Mrz valid = new Mrz(valid_passport_mrz); assertTrue(valid.valid()); }
@Test public void valid_id_mrz() throws Exception { Mrz valid = new Mrz(valid_id_mrz); assertTrue(valid.valid()); }
@Test public void invalid_passport_mrz() throws Exception { Mrz invalid = new Mrz(invalid_passport_mrz); assertFalse(invalid.valid()); }
@Test public void invalid_id_mrz() throws Exception { Mrz invalid = new Mrz(invalid_id_mrz); assertFalse(invalid.valid()); }
@Test public void null_check() throws Exception { Mrz invalid = new Mrz(null); assertFalse(invalid.valid()); }
@Test public void empty_string_is_invalid() throws Exception { Mrz invalid = new Mrz(""); assertFalse(invalid.valid()); }