OnActivityResultProcessor extends AbstractProcessor { @Override public Set<String> getSupportedAnnotationTypes() { final Set<String> supportedAnnotations = new HashSet<>(); supportedAnnotations.add(OnActivityResult.class.getCanonicalName()); supportedAnnotations.add(IntentData.class.getCanonicalName()); supportedAnnotations.add(ExtraBoolean.class.getCanonicalName()); supportedAnnotations.add(ExtraByte.class.getCanonicalName()); supportedAnnotations.add(ExtraChar.class.getCanonicalName()); supportedAnnotations.add(ExtraDouble.class.getCanonicalName()); supportedAnnotations.add(ExtraFloat.class.getCanonicalName()); supportedAnnotations.add(ExtraInt.class.getCanonicalName()); supportedAnnotations.add(ExtraLong.class.getCanonicalName()); supportedAnnotations.add(ExtraShort.class.getCanonicalName()); supportedAnnotations.add(ExtraString.class.getCanonicalName()); supportedAnnotations.add(Extra.class.getCanonicalName()); return supportedAnnotations; }  @Override void init(final ProcessingEnvironment environment); @Override Set<String> getSupportedAnnotationTypes(); @Override boolean process(final Set<? extends TypeElement> elements, final RoundEnvironment environment); @Override SourceVersion getSupportedSourceVersion();  }
@Test public void getSupportedAnnotationTypes() { final OnActivityResultProcessor onActivityResultProcessor = new OnActivityResultProcessor(); final Set<String> supportedAnnotationTypes = onActivityResultProcessor.getSupportedAnnotationTypes(); final String[] strings = supportedAnnotationTypes.toArray(new String[0]); final String[] expected = new String[] { "onactivityresult.ExtraByte", "onactivityresult.ExtraLong", "onactivityresult.IntentData", "onactivityresult.ExtraDouble", "onactivityresult.ExtraString", "onactivityresult.ExtraFloat", "onactivityresult.ExtraChar", "onactivityresult.Extra", "onactivityresult.ExtraBoolean", "onactivityresult.OnActivityResult", "onactivityresult.ExtraInt", "onactivityresult.ExtraShort", }; assertArrayEquals(expected, strings); }