// Path: src/main/java/org/fest/util/Arrays.java
// public static <T> boolean isNullOrEmpty(@Nullable T[] array) {
//   return array == null || !hasElements(array);
// }
// 
// Path: src/main/java/org/fest/util/Strings.java
// public static @NotNull String concat(@NotNull Object... objects) {
//   checkNotNull(objects);
//   StringBuilder b = new StringBuilder();
//   for (Object o : objects) {
//     b.append(o);
//   }
//   return b.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;
// }


import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
import static java.io.File.separator;
import static java.lang.String.format;
import static org.fest.util.Arrays.isNullOrEmpty;
import static org.fest.util.Strings.concat;
import static org.fest.util.Strings.quote;
import static org.junit.Assert.assertTrue;

  public FolderFixture addFolder(String folderName) {
    FolderFixture child = new FolderFixture(folderName, this);
    folders.add(child);
    return child;
  }

  public FolderFixture addFiles(String... names) throws IOException {
    for (String file : names) {
      files.add(new FileFixture(file, this));
    }
    return this;
  }

  public void delete() {
    for (FolderFixture folder : folders) {
      folder.delete();
    }
    for (FileFixture file : files) {
      file.delete();
    }
    String path = relativePath();
    boolean dirDeleted = dir.delete();
    if (!dirDeleted) {
      throw new AssertionError(String.format("Unable to delete directory %s", quote(path)));
    }
    logger.info(format("The directory %s was deleted", quote(path)));
  }

  String relativePath() {
// Path: src/main/java/org/fest/util/Arrays.java
// public static <T> boolean isNullOrEmpty(@Nullable T[] array) {
//   return array == null || !hasElements(array);
// }
// 
// Path: src/main/java/org/fest/util/Strings.java
// public static @NotNull String concat(@NotNull Object... objects) {
//   checkNotNull(objects);
//   StringBuilder b = new StringBuilder();
//   for (Object o : objects) {
//     b.append(o);
//   }
//   return b.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/FolderFixture.java
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
import static java.io.File.separator;
import static java.lang.String.format;
import static org.fest.util.Arrays.isNullOrEmpty;
import static org.fest.util.Strings.concat;
import static org.fest.util.Strings.quote;
import static org.junit.Assert.assertTrue;


  public FolderFixture addFolder(String folderName) {
    FolderFixture child = new FolderFixture(folderName, this);
    folders.add(child);
    return child;
  }

  public FolderFixture addFiles(String... names) throws IOException {
    for (String file : names) {
      files.add(new FileFixture(file, this));
    }
    return this;
  }

  public void delete() {
    for (FolderFixture folder : folders) {
      folder.delete();
    }
    for (FileFixture file : files) {
      file.delete();
    }
    String path = relativePath();
    boolean dirDeleted = dir.delete();
    if (!dirDeleted) {
      throw new AssertionError(String.format("Unable to delete directory %s", quote(path)));
    }
    logger.info(format("The directory %s was deleted", quote(path)));
  }

  String relativePath() {
    return parent != null ? concat(parent.relativePath(), separator, name) : name;