// Path: src/main/java/org/fest/util/Strings.java
// public static @Nullable String quote(@Nullable String s) {
//   return s != null ? String.format("'%s'", s) : null;
// }


import org.junit.BeforeClass;
import org.junit.Test;
import static org.fest.util.Strings.quote;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;

  @Test
  public void should_format_Object_array() {
    assertEquals("['Hello', 'Anakin']", formatter.format(new Object[]{"Hello", new Person("Anakin")}));
  }

  @Test
  public void should_format_Object_array_that_has_primitive_array_as_element() {
    boolean booleans[] = {true, false};
    Object[] array = {"Hello", booleans};
    assertEquals("['Hello', [true, false]]", formatter.format(array));
  }

  @Test
  public void should_format_Object_array_having_itself_as_element() {
    Object[] array1 = {"Hello", "World"};
    Object[] array2 = {array1};
    array1[1] = array2;
    assertEquals("[['Hello', [...]]]", formatter.format(array2));
  }

  private static class Person {
    private final String name;

    Person(String name) {
      this.name = name;
    }

    @Override
    public String toString() {
// Path: src/main/java/org/fest/util/Strings.java
// public static @Nullable String quote(@Nullable String s) {
//   return s != null ? String.format("'%s'", s) : null;
// }


// Path: src/test/java/org/fest/util/ArrayFormatter_format_Test.java
import org.junit.BeforeClass;
import org.junit.Test;
import static org.fest.util.Strings.quote;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;


  @Test
  public void should_format_Object_array() {
    assertEquals("['Hello', 'Anakin']", formatter.format(new Object[]{"Hello", new Person("Anakin")}));
  }

  @Test
  public void should_format_Object_array_that_has_primitive_array_as_element() {
    boolean booleans[] = {true, false};
    Object[] array = {"Hello", booleans};
    assertEquals("['Hello', [true, false]]", formatter.format(array));
  }

  @Test
  public void should_format_Object_array_having_itself_as_element() {
    Object[] array1 = {"Hello", "World"};
    Object[] array2 = {array1};
    array1[1] = array2;
    assertEquals("[['Hello', [...]]]", formatter.format(array2));
  }

  private static class Person {
    private final String name;

    Person(String name) {
      this.name = name;
    }

    @Override
    public String toString() {
      return quote(name);