class GroupTypeDescription {
  private static final int SPLITERATORS_CLASS_STACK_TRACE_NUM = 5;
  private String groupTypeName;
  private String elementTypeName;

  public GroupTypeDescription(String groupTypeName, String elementTypeName) {
    this.groupTypeName = groupTypeName;
    this.elementTypeName = elementTypeName;
  }

  public String getElementTypeName() {
    return elementTypeName;
  }

  public String getGroupTypeName() {
    return groupTypeName;
  }

  /**
   * Creates a new <code>{@link GroupTypeDescription}</code> for a group of elements.
   *
   * @param actual the group of elements.
   * @return the created GroupTypeDescription object
   */
  public static GroupTypeDescription getGroupTypeDescription(Object actual) {
    return getGroupTypeDescription(actual.getClass());
  }

  /**
   * Creates a new <code>{@link GroupTypeDescription}</code> for a group of elements.
   *
   * @param clazz the class for the group of elements.
   * @return the created GroupTypeDescription object
   */
  public static GroupTypeDescription getGroupTypeDescription(Class<?> clazz) {<FILL_FUNCTION_BODY>}
}


    if (Thread.currentThread().getStackTrace()[SPLITERATORS_CLASS_STACK_TRACE_NUM].getClassName().contains("Spliterators"))
      return new GroupTypeDescription("spliterator characteristics", "characteristics");

    if (Map.class.isAssignableFrom(clazz)) return new GroupTypeDescription("map", "map entries");

    if (clazz.isArray())
      return new GroupTypeDescription(clazz.getSimpleName(), clazz.getComponentType().getSimpleName().toLowerCase() + "(s)");

    return new GroupTypeDescription(clazz.getSimpleName(), "element(s)");
  
<no_super_class>