private static <T extends Collection<Class<?>>> T getCommonClasses(final T result, final Object... implementations) {
    if (implementations.length > 0) {
      DomUtil.getAllInterfaces(implementations[0].getClass(), result);
      for (int i = 1; i < implementations.length; i++) {
        final ArrayList<Class<?>> list1 = new ArrayList<>();
        DomUtil.getAllInterfaces(implementations[i].getClass(), list1);
        result.retainAll(list1);
      }
    }
    return result;
  }
private static <T extends Collection<Class<?>>> T getCommonClasses(final T result, final Object... implementations)