}
private void assertSourceCastsToTargets(JProgram program, JReferenceType sourceType,
Set<String> expectedTargetTypeNames) {
// Gets the castmap for the given source type.
JCastMap castMap = program.getCastMap(sourceType);
// Converts the castmap entries to runtime type references.
List<JRuntimeTypeReference> runtimeTypeReferences = Lists.newArrayList(
Iterables.filter(castMap.getCanCastToTypes(), JRuntimeTypeReference.class));
// Makes a set of the names of the runtime type references.
Set<String> actualTargetTypeNames = Sets.newHashSet(
Lists.transform(runtimeTypeReferences, new Function<JRuntimeTypeReference, String>() {
@Override