/* package whatever; // don't place package name! */

import java.lang.reflect.*;
import java.util.*;
import java.util.stream.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone {
  static String simpleTypeName(Type t) {
    if (t instanceof ParameterizedType) {
      ParameterizedType p = (ParameterizedType) t;
      return simpleTypeName(p.getRawType())
          + Stream.of(p.getActualTypeArguments())
              .map(Ideone::simpleTypeName)
              .collect(Collectors.joining(", ", "<", ">"));
    } else if (t instanceof Class) {
      Class<?> c = (Class<?>) t;
      return c.getSimpleName();
    } else {
      throw new AssertionError();
    }
  }

  static List<String> list() {
    throw new AssertionError();
  }

  public static void main(String[] args) throws java.lang.Exception {
    Method m = Ideone.class.getDeclaredMethod("list");
    System.out.println(simpleTypeName(m.getGenericReturnType()));
  }
}
