### Question:
HasSmsPermissionAnalysis extends BaseAnalysisPlugin { @Override public void analyze(AppAnalysisReport report, App app) { if (app.hasPermission(PERMISSION_RECEIVE_SMS)) { report.label(app, YES); } else { report.label(app, NO); } }  @Override void analyze(AppAnalysisReport report, App app); static final String PERMISSION_RECEIVE_SMS; static final String YES; static final String NO; }### Answer:
@Test public void testHasSmsPermissionAnalysis() throws Exception { Config config = getXmlConfig("/has-sms-permission-analysis.xml"); AppAnalysisPlugin plugin = config.getComponentAndInit(AppAnalysisPlugin.class); assertNotNull(plugin); App app = new App(); app.setManifest(new AndroidManifest("com.oprisnik.test")); app.getManifest().addPermission(new Permission("com.oprisnik.test.DEMO_PERMISSION")); AppAnalysisReport r1 = plugin.analyze(app); assertNotNull(r1); assertEquals(1, r1.getLabels().size()); assertEquals(HasSmsPermissionAnalysis.NO, r1.getLabels().iterator().next().getName()); app.getManifest().addPermission(new Permission(HasSmsPermissionAnalysis.PERMISSION_RECEIVE_SMS)); AppAnalysisReport r2 = plugin.analyze(app); assertNotNull(r2); assertEquals(1, r2.getLabels().size()); assertEquals(HasSmsPermissionAnalysis.YES, r2.getLabels().iterator().next().getName()); }