code: public static String determineMostSpecificType(final String... types) {
          switch (types.length) {
              case 0:
                  throw new IllegalArgumentException("At least one type has to be provided");
              case 1:
                  return types[0];
              case 2:
                  return determineMostSpecific(types[0], types[1]);
              default:
                  String currentMostSpecific = determineMostSpecific(types[0], types[1]);
                  for (int i = 2; i < types.length; i++) {
                      currentMostSpecific = determineMostSpecific(currentMostSpecific, types[i]);
                  }
                  return currentMostSpecific;
          }
      }
docs: Determines the type which is most "specific" (i. e. parametrized types are more "specific" than generic types,
  types which are not {@link Object} are less specific). If no exact statement can be made, the first type is chosen.
  
  @param types The types
  @return The most "specific" type