I hate that TypeElement is so enmeshed with annotation processing environment crap that you can't effectively unit test this.  You could split this into the wrapper function which extracts raw strings, then the worker function which does all the string stuff, but I think that complicates the code too much for the sake of limited testing value.   I think you have enough coverage in the integration tests, and ASSERT.about(javaSources()).that(foo).generates(bar); will allow for a reasonable amount of test coverage in a more simple way.