code: public static List<Class<?>> filterSameParameterizedTypes(final List<Class<?>> types, final Type type) {
          if (type instanceof ParameterizedType) {
              Type[] fieldArugmentTypes = ((ParameterizedType) type).getActualTypeArguments();
              List<Class<?>> typesWithSameParameterizedTypes = new ArrayList<>();
              for (Class<?> currentConcreteType : types) {
                  List<Type[]> actualTypeArguments = getActualTypeArgumentsOfGenericInterfaces(currentConcreteType);
                  typesWithSameParameterizedTypes.addAll(actualTypeArguments.stream().filter(currentTypeArguments -> Arrays.equals(fieldArugmentTypes, currentTypeArguments)).map(currentTypeArguments -> currentConcreteType).collect(toList()));
              }
              return typesWithSameParameterizedTypes;
          }
          return types;
      }
docs: Filters a list of types to keep only elements having the same parameterized types as the given type.
  
  @param type  the type to use for the search
  @param types a list of types to filter
  @return a list of types having the same parameterized types as the given type