code: private static Collection<Class<?>> filterInterfaces(Class<?> object, Class<?> base)
      {
          return Arrays.asList(object.getInterfaces())
                       .stream()
                       .filter(current -> base.isAssignableFrom(current) && !current.equals(base))
                       .collect(Collectors.toList());
      }
docs: Get all direct interfaces from object filtered by base interface (excluded).
  
  @param object The object reference.
  @param base The minimum base interface.
  @return The declared interfaces.