public static Collection < Class < ? > > serviceInterfaces ( Object serviceObject ) { Class < ? > [ ] interfaces = serviceObject . getClass ( ) . getInterfaces ( ) ; return Arrays . stream ( interfaces ) . filter ( interfaceClass -> interfaceClass . isAnnotationPresent ( Service . class ) ) . collect ( Collectors . toList ( ) ) ; }
Util function to get service interfaces collections from service instance .