QuantumProcessor extends AbstractProcessor { @VisibleForTesting static String getClassName(TypeElement type, String packageName) { int packageLen = packageName.length() + 1; return type.getQualifiedName().toString().substring(packageLen).replace('.', '$'); }  @Override Set<String> getSupportedAnnotationTypes(); @Override SourceVersion getSupportedSourceVersion(); @Override synchronized void init(ProcessingEnvironment processingEnv); @Override boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv);  }
@Test public void shouldGetClassName() { TypeElement mockType = mock(TypeElement.class); Name mockName = mock(Name.class); when(mockName.toString()).thenReturn("quantum.sample.MainActivity"); when(mockType.getQualifiedName()).thenReturn(mockName); String className = QuantumProcessor.getClassName(mockType, "quantum.sample"); assertThat(className, is("MainActivity")); }