Sounds like you're looking for Error Prone's https://errorprone.info/bugpattern/ArgumentSelectionDefectChecker, which would be much simpler than the approaches you seem to be looking at.