@Test
	void applyClassWithAnnotation() {
		String annotationName = AnnotationImpl.class.getName().replace('.', '/');
		String classWithAnnotationName = ClassWithAnnotation.class.getName().replace('.', '/');

		// Create mappings for all classes but the target 'ClassWithAnnotation'
		Mappings mappings = mappingGenerator.generate(workspace, resource, inheritanceGraph, nameGenerator, new NameGeneratorFilter(null, true) {
			@Override
			public boolean shouldMapClass(@Nonnull ClassInfo info) {
				return !info.getName().equals(classWithAnnotationName);
			}
		});

		// Preview the mapping operation
		MappingResults results = mappingApplierService.inCurrentWorkspace().applyToPrimaryResource(mappings);

		// The annotation class we define should be remapped.
		// The user class (ClassWithAnnotation) itself should not be remapped,
		// but its annotation usage should be updated.
		String mappedAnnotationName = mappings.getMappedClassName(annotationName);
		assertNotNull(mappedAnnotationName, "AnnotationImpl should be remapped");
		assertNull(mappings.getMappedClassName(classWithAnnotationName), "ClassWithAnnotation should not be remapped");
		assertTrue(results.wasMapped(annotationName), "AnnotationImpl should have updated");
		assertTrue(results.wasMapped(classWithAnnotationName), "ClassWithAnnotation should have updated");

		// Assert aggregate updated too.
		results.apply();
		AggregatedMappings aggregatedMappings = aggregateMappingManager.getAggregatedMappings();
		assertNotNull(aggregatedMappings);
		assertNotNull(aggregatedMappings.getMappedClassName(annotationName),
				"AnnotationImpl should be tracked in aggregate");

		// Get the names of the annotation's mapped attribute methods
		String annoValueName = mappings.getMappedMethodName(annotationName, "value", "()Ljava/lang/String;");
		String annoPolicyName = mappings.getMappedMethodName(annotationName, "policy", "()Ljava/lang/annotation/Retention;");

		// Assert the user class has the correct new values
		ClassPathNode classPath = results.getPostMappingPath(classWithAnnotationName);
		assertNotNull(classPath, "Could not find: " + classWithAnnotationName);
		JvmClassInfo classWithAnnotation = classPath.getValue().asJvmClass();
		AnnotationInfo annotationInfo = classWithAnnotation.getAnnotations().get(0);
		assertEquals("L" + mappedAnnotationName + ";", annotationInfo.getDescriptor(),
				"AnnotationImpl not remapped in ClassWithAnnotation");
		AnnotationElement valueElement = annotationInfo.getElements().get(annoValueName);
		AnnotationElement policyElement = annotationInfo.getElements().get(annoPolicyName);
		assertNotNull(valueElement, "Missing mapped value element");
		assertNotNull(policyElement, "Missing mapped policy element");
	}
Tests for {@link MappingApplier} with some edge case classes.
recaf-core/src/test/java/software/coley/recaf/services/mapping/MappingApplierTest.java