class ToStringBuilder {
  private final Map<String, Object> properties = new LinkedHashMap<String, Object>();
  private final String name;

  public ToStringBuilder(Class<?> type) {
    this.name = type.getSimpleName();
  }

  public ToStringBuilder add(String name, Object value) {<FILL_FUNCTION_BODY>}

  @Override
  public String toString() {
    return name + properties.toString().replace('{', '[').replace('}', ']');
  }

  static class ArrayWrapper {
    private final Object[] array;

    ArrayWrapper(Object array) {
      this.array = (Object[]) array;
    }

    @Override
    public String toString() {
      return Arrays.toString(array);
    }
  }
}

    value = value.getClass().isArray() ? new ArrayWrapper(value) : value;

    if (properties.put(name, value) != null)
      throw new RuntimeException("Duplicate property: " + name);
    return this;
  
<no_super_class>