branchContains method was deprecated in checkstyle due to unexpected side-effects (too deep subtree scanning) and it's recommended to write your own traversal implementations for per need. BranchContains class is quite universal implementation for most needs, so i think it shouldn't be removed.
although, BranchContains class is only used in NonStaticMethodCheck for now and it's possible to move the BranchContains functionality to NonStaticMethodCheck's private method (we can discuss which way is better)
Closes: #1180
branchContains method was deprecated in checkstyle due to unexpected side-effects (too deep subtree scanning) and it's recommended to write your own traversal implementations for per need. BranchContains class is quite universal implementation for most needs, so i think it shouldn't be removed.
although, BranchContains class is only used in NonStaticMethodCheck for now and it's possible to move the BranchContains functionality to NonStaticMethodCheck's private method (we can discuss which way is better)