ModelStatement.statementSource() is a confusing contract, as it allows for DeclaredStatements which are not StatementOrigin.DECLARATION. A DeclaredStatement is by definition declared, so this does not quite make sense.
Based on historical record, the interface design comes from 2015 (Java 7). In Java 8 world, though, and thus have a consistent way of saying that:
- DeclaredStatement is always StatementOrigin.DECLARATION
- EffectiveStatement is either one of the possibilities based on getDeclared() being null (or not)
Remove all ModelStatement.statementSource() implementations in favor of default implementations in DeclaredStatement and EffectiveStatement.