MatpowerImporter implements Importer { @Override public boolean exists(ReadOnlyDataSource dataSource) { try { return dataSource.exists(null, EXT); } catch (IOException e) { throw new UncheckedIOException(e); } }  @Override boolean exists(ReadOnlyDataSource dataSource); @Override String getComment(); @Override String getFormat(); @Override void copy(ReadOnlyDataSource fromDataSource, DataSource toDataSource); @Override List<Parameter> getParameters(); @Override Network importData(ReadOnlyDataSource dataSource, NetworkFactory networkFactory, Properties parameters);  }
@Test public void existsTest() throws IOException { MatpowerModel model = MatpowerModelFactory.create118(); Path matpowerBinCase = tmpDir.resolve(model.getCaseName() + ".mat"); MatpowerWriter.write(model, matpowerBinCase); assertTrue(new MatpowerImporter().exists(new FileDataSource(tmpDir, model.getCaseName()))); assertFalse(new MatpowerImporter().exists(new FileDataSource(tmpDir, "doesnotexist"))); }