There is no point in restricting what instances we can seach for,
make sure we can work with any class.
Change-Id: Ia8834fd5a7550295b861d3494b5a343d760d3e86
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
974385ed778393e2b28c3ef771ced6c3337c543c)
* @return First effective substatement, or empty if no match is found.
*/
@Beta
- default <T extends EffectiveStatement<?, ?>> Optional<T> findFirstEffectiveSubstatement(
- final @NonNull Class<T> type) {
+ default <T> Optional<T> findFirstEffectiveSubstatement(final @NonNull Class<T> type) {
return effectiveSubstatements().stream().filter(type::isInstance).findFirst().map(type::cast);
}