DrbImageManager { boolean checkFilename (String filename, boolean verbose) { try { String mgrs = getMGRSFromName(filename); if (mgrs==null) new NullPointerException("MGRS string not extracted."); MGRSCoord.fromString(mgrs); } catch (Exception e) { if (verbose) { logger.error("Wrong input image file (" + e.getMessage() + ")."); } return false; } return true; } DrbImageManager(); void add(DrbImage image); void addAll(Collection<DrbImage> images); Bands[][] getMosaic();  }
@Test public void checkMGRS () { String ok = "T36JTT_20160914T074612_PVI.jp2"; String nok = "T34MFR_20160914T074612_B01.jp2"; String nok1 = "XXXXX_20160914T074612_B01.jp2"; Assert.assertEquals(mgr.checkFilename (ok, false), true); Assert.assertEquals(mgr.checkFilename (nok, false), false); Assert.assertEquals(mgr.checkFilename (nok1, false), false); }