refactored validateClassDefinitionHasSameName in CompilationUnit