@Test
	void applyAnonymousLambda() {
		String stringSupplierName = StringSupplier.class.getName().replace('.', '/');
		String anonymousLambdaName = AnonymousLambda.class.getName().replace('.', '/');

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

			@Override
			public boolean shouldMapMethod(@Nonnull ClassInfo owner, @Nonnull MethodMember method) {
				return shouldMapClass(owner);
			}
		});

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

		// The supplier class we define should be remapped.
		// The runner class (AnonymousLambda) itself should not be remapped, but should be updated to point to
		// the new StringSupplier class name.
		String mappedStringSupplierName = mappings.getMappedClassName(stringSupplierName);
		assertNotNull(mappedStringSupplierName, "StringSupplier should be remapped");
		assertNull(mappings.getMappedClassName(anonymousLambdaName), "AnonymousLambda should not be remapped");
		assertTrue(results.wasMapped(stringSupplierName), "StringSupplier should have updated");
		assertTrue(results.wasMapped(anonymousLambdaName), "AnonymousLambda should have updated");

		// Verify that the original name is stored as a property.
		ClassPathNode classPath = results.getPostMappingPath(stringSupplierName);
		assertNotNull(classPath, "Could not find mapped StringSupplier in workspace");
		JvmClassInfo mappedStringSupplier = classPath.getValue().asJvmClass();
		assertEquals(stringSupplierName, OriginalClassNameProperty.get(mappedStringSupplier),
				"Did not record original name after applying mappings");

		// Assert that the method is still runnable.
		String result = runMapped(AnonymousLambda.class, "run");
		assertTrue(result.contains("One: java.util.function.Supplier"),
				"JDK class reference should not be mapped");
		assertFalse(result.contains(stringSupplierName),
				"Class reference to '" + stringSupplierName + "' should have been remapped");

		// Assert aggregate updated too.
		// We will validate this is only done AFTER 'results.apply()' is run.
		// For future tests we will skip this since if it works here, it works there.
		AggregatedMappings aggregatedMappings = aggregateMappingManager.getAggregatedMappings();
		assertNotNull(aggregatedMappings);
		assertNull(aggregatedMappings.getMappedClassName(stringSupplierName),
				"StringSupplier should not yet be tracked in aggregate");
		results.apply();
		assertNotNull(aggregatedMappings.getMappedClassName(stringSupplierName),
				"StringSupplier should be tracked in aggregate");
	}
Tests for {@link MappingApplier} with some edge case classes.
recaf-core/src/test/java/software/coley/recaf/services/mapping/MappingApplierTest.java