// Path: src/main/java/com/pathfinder/api/GraphTraversalService.java
// public interface GraphTraversalService extends Remote {
// 
//   /**
//    * @param origin origin point
//    * @param destination destination point
//    * @param limitations restrictions on the path selection, as key-value according to some API specification
//    * @return A list of transit paths
//    * @throws java.rmi.RemoteException RMI problem
//    */
//   List<TransitPath> findShortestPath(String origin,
//                                      String destination,
//                                      Properties limitations);
// 
// }
// 
// Path: src/main/java/com/pathfinder/internal/GraphDAO.java
// public interface GraphDAO {
// 	List<String> listAllNodes();
// 	String getTransitEdge(String from, String to);
// }
// 
// Path: src/main/java/com/pathfinder/internal/GraphDAOStub.java
// public class GraphDAOStub implements GraphDAO{
// 
//   private static final Random random = new Random();
// 
//   public List<String> listAllNodes() {
//     return new ArrayList<String>(Arrays.asList(
//       "CNHKG", "AUMEL", "SESTO", "FIHEL", "USCHI", "JNTKO", "DEHAM", "CNSHA", "NLRTM", "SEGOT", "CNHGH", "USNYC", "USDAL"
//     ));
//   }
// 
//   public String getTransitEdge(String from, String to) {
//     final int i = random.nextInt(5);
//     if (i == 0) return "0100S";
//     if (i == 1) return "0200T";
//     if (i == 2) return "0300A";
//     if (i == 3) return "0301S";
//     return "0400S";
//   }
//   
// }
// 
// Path: src/main/java/com/pathfinder/internal/GraphTraversalServiceImpl.java
// public class GraphTraversalServiceImpl implements GraphTraversalService {
// 
//   private GraphDAO dao;
//   private Random random;
//   private static final long ONE_MIN_MS = 1000 * 60;
//   private static final long ONE_DAY_MS = ONE_MIN_MS * 60 * 24;
// 
//   public GraphTraversalServiceImpl(GraphDAO dao) {
//     this.dao = dao;
//     this.random = new Random();
//   }
// 
//   public List<TransitPath> findShortestPath(final String originNode,
//                                             final String destinationNode,
//                                             final Properties limitations) {
//     Date date = nextDate(new Date());
// 
//     List<String> allVertices = dao.listAllNodes();
//     allVertices.remove(originNode);
//     allVertices.remove(destinationNode);
// 
//     final int candidateCount = getRandomNumberOfCandidates();
//     final List<TransitPath> candidates = new ArrayList<TransitPath>(candidateCount);
// 
//     for (int i = 0; i < candidateCount; i++) {
//       allVertices = getRandomChunkOfNodes(allVertices);
//       final List<TransitEdge> transitEdges = new ArrayList<TransitEdge>(allVertices.size() - 1);
//       final String firstLegTo = allVertices.get(0);
// 
//       Date fromDate = nextDate(date);
//       Date toDate = nextDate(fromDate);
//       date = nextDate(toDate);
// 
//       transitEdges.add(new TransitEdge(
//         dao.getTransitEdge(originNode, firstLegTo),
//         originNode, firstLegTo, fromDate, toDate));
// 
//       for (int j = 0; j < allVertices.size() - 1; j++) {
//         final String curr = allVertices.get(j);
//         final String next = allVertices.get(j + 1);
//         fromDate = nextDate(date);
//         toDate = nextDate(fromDate);
//         date = nextDate(toDate);
//         transitEdges.add(new TransitEdge(dao.getTransitEdge(curr, next), curr, next, fromDate, toDate));
//       }
// 
//       final String lastLegFrom = allVertices.get(allVertices.size() - 1);
//       fromDate = nextDate(date);
//       toDate = nextDate(fromDate);
//       transitEdges.add(new TransitEdge(
//         dao.getTransitEdge(lastLegFrom, destinationNode),
//         lastLegFrom, destinationNode, fromDate, toDate));
// 
//       candidates.add(new TransitPath(transitEdges));
//     }
// 
//     return candidates;
//   }
// 
//   private Date nextDate(Date date) {
//     return new Date(date.getTime() + ONE_DAY_MS + (random.nextInt(1000) - 500) * ONE_MIN_MS);
//   }
// 
//   private int getRandomNumberOfCandidates() {
//     return 3 + random.nextInt(3);
//   }
// 
//   private List<String> getRandomChunkOfNodes(List<String> allNodes) {
//     Collections.shuffle(allNodes);
//     final int total = allNodes.size();
//     final int chunk = total > 4 ? 1 + new Random().nextInt(5) : total;
//     return allNodes.subList(0, chunk);
//   }
// 
// }


import com.pathfinder.api.GraphTraversalService;
import com.pathfinder.internal.GraphDAO;
import com.pathfinder.internal.GraphDAOStub;
import com.pathfinder.internal.GraphTraversalServiceImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
package com.pathfinder.config;


@Configuration
public class PathfinderApplicationContext {

// Path: src/main/java/com/pathfinder/api/GraphTraversalService.java
// public interface GraphTraversalService extends Remote {
// 
//   /**
//    * @param origin origin point
//    * @param destination destination point
//    * @param limitations restrictions on the path selection, as key-value according to some API specification
//    * @return A list of transit paths
//    * @throws java.rmi.RemoteException RMI problem
//    */
//   List<TransitPath> findShortestPath(String origin,
//                                      String destination,
//                                      Properties limitations);
// 
// }
// 
// Path: src/main/java/com/pathfinder/internal/GraphDAO.java
// public interface GraphDAO {
// 	List<String> listAllNodes();
// 	String getTransitEdge(String from, String to);
// }
// 
// Path: src/main/java/com/pathfinder/internal/GraphDAOStub.java
// public class GraphDAOStub implements GraphDAO{
// 
//   private static final Random random = new Random();
// 
//   public List<String> listAllNodes() {
//     return new ArrayList<String>(Arrays.asList(
//       "CNHKG", "AUMEL", "SESTO", "FIHEL", "USCHI", "JNTKO", "DEHAM", "CNSHA", "NLRTM", "SEGOT", "CNHGH", "USNYC", "USDAL"
//     ));
//   }
// 
//   public String getTransitEdge(String from, String to) {
//     final int i = random.nextInt(5);
//     if (i == 0) return "0100S";
//     if (i == 1) return "0200T";
//     if (i == 2) return "0300A";
//     if (i == 3) return "0301S";
//     return "0400S";
//   }
//   
// }
// 
// Path: src/main/java/com/pathfinder/internal/GraphTraversalServiceImpl.java
// public class GraphTraversalServiceImpl implements GraphTraversalService {
// 
//   private GraphDAO dao;
//   private Random random;
//   private static final long ONE_MIN_MS = 1000 * 60;
//   private static final long ONE_DAY_MS = ONE_MIN_MS * 60 * 24;
// 
//   public GraphTraversalServiceImpl(GraphDAO dao) {
//     this.dao = dao;
//     this.random = new Random();
//   }
// 
//   public List<TransitPath> findShortestPath(final String originNode,
//                                             final String destinationNode,
//                                             final Properties limitations) {
//     Date date = nextDate(new Date());
// 
//     List<String> allVertices = dao.listAllNodes();
//     allVertices.remove(originNode);
//     allVertices.remove(destinationNode);
// 
//     final int candidateCount = getRandomNumberOfCandidates();
//     final List<TransitPath> candidates = new ArrayList<TransitPath>(candidateCount);
// 
//     for (int i = 0; i < candidateCount; i++) {
//       allVertices = getRandomChunkOfNodes(allVertices);
//       final List<TransitEdge> transitEdges = new ArrayList<TransitEdge>(allVertices.size() - 1);
//       final String firstLegTo = allVertices.get(0);
// 
//       Date fromDate = nextDate(date);
//       Date toDate = nextDate(fromDate);
//       date = nextDate(toDate);
// 
//       transitEdges.add(new TransitEdge(
//         dao.getTransitEdge(originNode, firstLegTo),
//         originNode, firstLegTo, fromDate, toDate));
// 
//       for (int j = 0; j < allVertices.size() - 1; j++) {
//         final String curr = allVertices.get(j);
//         final String next = allVertices.get(j + 1);
//         fromDate = nextDate(date);
//         toDate = nextDate(fromDate);
//         date = nextDate(toDate);
//         transitEdges.add(new TransitEdge(dao.getTransitEdge(curr, next), curr, next, fromDate, toDate));
//       }
// 
//       final String lastLegFrom = allVertices.get(allVertices.size() - 1);
//       fromDate = nextDate(date);
//       toDate = nextDate(fromDate);
//       transitEdges.add(new TransitEdge(
//         dao.getTransitEdge(lastLegFrom, destinationNode),
//         lastLegFrom, destinationNode, fromDate, toDate));
// 
//       candidates.add(new TransitPath(transitEdges));
//     }
// 
//     return candidates;
//   }
// 
//   private Date nextDate(Date date) {
//     return new Date(date.getTime() + ONE_DAY_MS + (random.nextInt(1000) - 500) * ONE_MIN_MS);
//   }
// 
//   private int getRandomNumberOfCandidates() {
//     return 3 + random.nextInt(3);
//   }
// 
//   private List<String> getRandomChunkOfNodes(List<String> allNodes) {
//     Collections.shuffle(allNodes);
//     final int total = allNodes.size();
//     final int chunk = total > 4 ? 1 + new Random().nextInt(5) : total;
//     return allNodes.subList(0, chunk);
//   }
// 
// }


// Path: src/main/java/com/pathfinder/config/PathfinderApplicationContext.java
import com.pathfinder.api.GraphTraversalService;
import com.pathfinder.internal.GraphDAO;
import com.pathfinder.internal.GraphDAOStub;
import com.pathfinder.internal.GraphTraversalServiceImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

package com.pathfinder.config;


@Configuration
public class PathfinderApplicationContext {

    private GraphDAO graphDAO() {