AbbreviationServiceImpl implements AbbreviationService { InputStream findFile(String path) { File f = new File(path); if (f.isFile() && f.canRead()) { try { return new FileInputStream(f); } catch (Exception ex) { } } return getClass().getResourceAsStream(path); }  void activate(ComponentContext context); @Override Abbreviations getAbbreviations(String s);  }
@Test(dataProvider="findFileTests") public void testFindFile(String path, String fileProperty) throws IOException { InputStream in; Properties p; p = new Properties(); in = abbrev.findFile(path); assertNotNull(in); p.load(in); assertEquals(p.getProperty("file"), fileProperty); }