// Path: gnikrap-core/src/main/java/org/gnikrap/utils/Configuration.java
// public final class Configuration {
//   private final JsonObject data;
// 
//   private Configuration(JsonObject data) {
//     this.data = data;
//   }
// 
//   public String getValueAsString(String path) {
//     return getValueAsString(path, null);
//   }
// 
//   public String getValueAsString(String path, String defaultValue) {
// 
//     return data.getString(path, defaultValue);
//   }
// 
//   public boolean getValueAsBoolean(String path) {
//     return getValueAsBoolean(path, false);
//   }
// 
//   public boolean getValueAsBoolean(String path, boolean defaultValue) {
//     return data.getBoolean(path, defaultValue);
//   }
// 
//   public int getValueAsInt(String path) {
//     return getValueAsInt(path, 0);
//   }
// 
//   public int getValueAsInt(String path, int defaultValue) {
//     return data.getInt(path, defaultValue);
//   }
// 
//   @Override
//   public String toString() {
//     return "Configuration: " + data.toString();
//   }
// 
//   /**
//    * Load the configuration file which have the name of the package.class in the following order:
//    * <ul>
//    * <li>File in the current folder: <user.dir></li>
//    * <li>If not found: look at <user.home>/.gnikrap/</li>
//    * <li>If not found: look in root classpath</li>
//    * <ul>
//    */
//   public static Configuration load(Class<?> clazzToConfigure) throws IOException {
//     String shortFileName = clazzToConfigure.getName() + ".config";
//     String configurationFile = System.getProperty("user.dir") + "/" + shortFileName;
// 
//     if (new File(configurationFile).exists() == false) {
//       configurationFile = System.getProperty("user.home") + "/.gnikrap/" + shortFileName;
//     }
// 
//     if (new File(configurationFile).exists()) {
//       try (Reader r = new FileReader(configurationFile)) {
//         return new Configuration(JsonObject.readFrom(r));
//       }
//     } else {
//       InputStream is = Configuration.class.getResourceAsStream("/" + shortFileName);
//       if (is != null) {
//         return new Configuration(JsonObject.readFrom(new InputStreamReader(is)));
//       } else {
//         throw new IOException("No configuration file found for: '" + shortFileName + "'");
//       }
//     }
//   }
// }


import org.gnikrap.utils.Configuration;
import org.testng.Assert;
import org.testng.annotations.Test;
import com.eclipsesource.json.JsonObject;
import com.eclipsesource.json.JsonObject.Member;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
    }
  }

  private Set<String> flatten(Map<String, JsonObject> ref) {
    Set<String> result = new TreeSet<>();
    for (Map.Entry<String, JsonObject> e : ref.entrySet()) {
      flatten(e.getValue(), e.getKey(), result);
    }
    return result;
  }

  private void flatten(JsonObject ref, String path, Set<String> target) {
    for (Member m : ref) {
      String newPath = path + (path.length() > 0 ? "." : "") + m.getName();
      if (m.getValue().isObject()) {
        flatten(m.getValue().asObject(), newPath, target);
      } else {
        if (!m.getName().startsWith("@")) {
          target.add(newPath);
        }
      }
    }
  }

  /**
   * Load the list of translation files available
   */
  private List<File> loadTranslationFiles() {
    String translationPath = null;
    try {
// Path: gnikrap-core/src/main/java/org/gnikrap/utils/Configuration.java
// public final class Configuration {
//   private final JsonObject data;
// 
//   private Configuration(JsonObject data) {
//     this.data = data;
//   }
// 
//   public String getValueAsString(String path) {
//     return getValueAsString(path, null);
//   }
// 
//   public String getValueAsString(String path, String defaultValue) {
// 
//     return data.getString(path, defaultValue);
//   }
// 
//   public boolean getValueAsBoolean(String path) {
//     return getValueAsBoolean(path, false);
//   }
// 
//   public boolean getValueAsBoolean(String path, boolean defaultValue) {
//     return data.getBoolean(path, defaultValue);
//   }
// 
//   public int getValueAsInt(String path) {
//     return getValueAsInt(path, 0);
//   }
// 
//   public int getValueAsInt(String path, int defaultValue) {
//     return data.getInt(path, defaultValue);
//   }
// 
//   @Override
//   public String toString() {
//     return "Configuration: " + data.toString();
//   }
// 
//   /**
//    * Load the configuration file which have the name of the package.class in the following order:
//    * <ul>
//    * <li>File in the current folder: <user.dir></li>
//    * <li>If not found: look at <user.home>/.gnikrap/</li>
//    * <li>If not found: look in root classpath</li>
//    * <ul>
//    */
//   public static Configuration load(Class<?> clazzToConfigure) throws IOException {
//     String shortFileName = clazzToConfigure.getName() + ".config";
//     String configurationFile = System.getProperty("user.dir") + "/" + shortFileName;
// 
//     if (new File(configurationFile).exists() == false) {
//       configurationFile = System.getProperty("user.home") + "/.gnikrap/" + shortFileName;
//     }
// 
//     if (new File(configurationFile).exists()) {
//       try (Reader r = new FileReader(configurationFile)) {
//         return new Configuration(JsonObject.readFrom(r));
//       }
//     } else {
//       InputStream is = Configuration.class.getResourceAsStream("/" + shortFileName);
//       if (is != null) {
//         return new Configuration(JsonObject.readFrom(new InputStreamReader(is)));
//       } else {
//         throw new IOException("No configuration file found for: '" + shortFileName + "'");
//       }
//     }
//   }
// }


// Path: gnikrap-core/src/test/java/webapp/TranslationTest.java
import org.gnikrap.utils.Configuration;
import org.testng.Assert;
import org.testng.annotations.Test;
import com.eclipsesource.json.JsonObject;
import com.eclipsesource.json.JsonObject.Member;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;

    }
  }

  private Set<String> flatten(Map<String, JsonObject> ref) {
    Set<String> result = new TreeSet<>();
    for (Map.Entry<String, JsonObject> e : ref.entrySet()) {
      flatten(e.getValue(), e.getKey(), result);
    }
    return result;
  }

  private void flatten(JsonObject ref, String path, Set<String> target) {
    for (Member m : ref) {
      String newPath = path + (path.length() > 0 ? "." : "") + m.getName();
      if (m.getValue().isObject()) {
        flatten(m.getValue().asObject(), newPath, target);
      } else {
        if (!m.getName().startsWith("@")) {
          target.add(newPath);
        }
      }
    }
  }

  /**
   * Load the list of translation files available
   */
  private List<File> loadTranslationFiles() {
    String translationPath = null;
    try {
      Configuration c = Configuration.load(TranslationTest.class);