diff --git a/OsmAnd-java/.classpath b/OsmAnd-java/.classpath
index 731f61c822..ad207c04e2 100644
--- a/OsmAnd-java/.classpath
+++ b/OsmAnd-java/.classpath
@@ -1,6 +1,7 @@
+
@@ -11,5 +12,8 @@
+
+
+
diff --git a/OsmAnd-java/build.xml b/OsmAnd-java/build.xml
index 2af488526d..3851c79f4c 100644
--- a/OsmAnd-java/build.xml
+++ b/OsmAnd-java/build.xml
@@ -10,6 +10,11 @@
+
+
+
+
+
@@ -18,6 +23,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
@@ -27,6 +44,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -62,7 +106,7 @@
-
+
@@ -83,14 +127,14 @@
-
+
-
+
@@ -111,6 +155,9 @@
+
+
+
diff --git a/OsmAnd-java/test-libs/gson-2.6.2.jar b/OsmAnd-java/test-libs/gson-2.6.2.jar
new file mode 100644
index 0000000000..9d78626d85
Binary files /dev/null and b/OsmAnd-java/test-libs/gson-2.6.2.jar differ
diff --git a/OsmAnd-java/test-libs/hamcrest-core-1.3.jar b/OsmAnd-java/test-libs/hamcrest-core-1.3.jar
new file mode 100644
index 0000000000..9d5fe16e3d
Binary files /dev/null and b/OsmAnd-java/test-libs/hamcrest-core-1.3.jar differ
diff --git a/OsmAnd-java/test-libs/junit-4.12.jar b/OsmAnd-java/test-libs/junit-4.12.jar
new file mode 100644
index 0000000000..3a7fc266c3
Binary files /dev/null and b/OsmAnd-java/test-libs/junit-4.12.jar differ
diff --git a/OsmAnd-java/test/java/net/osmand/router/RouteResultPreparationTest.java b/OsmAnd-java/test/java/net/osmand/router/RouteResultPreparationTest.java
new file mode 100644
index 0000000000..d56cc69f4b
--- /dev/null
+++ b/OsmAnd-java/test/java/net/osmand/router/RouteResultPreparationTest.java
@@ -0,0 +1,146 @@
+package net.osmand.router;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import net.osmand.PlatformUtil;
+import net.osmand.binary.BinaryMapIndexReader;
+import net.osmand.data.LatLon;
+import org.apache.commons.logging.Log;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import java.io.*;
+import java.util.*;
+
+/**
+ * Created by yurkiss on 04.03.16.
+ */
+
+@RunWith(Parameterized.class)
+public class RouteResultPreparationTest {
+
+ private static RoutePlannerFrontEnd fe;
+ private static RoutingContext ctx;
+
+ private String testName;
+ private LatLon startPoint;
+ private LatLon endPoint;
+ private Map expectedResults;
+
+ private Log log = PlatformUtil.getLog(RouteResultPreparationTest.class);
+
+ public RouteResultPreparationTest(String testName, LatLon startPoint, LatLon endPoint, Map expectedResults) {
+ this.testName = testName;
+ this.startPoint = startPoint;
+ this.endPoint = endPoint;
+ this.expectedResults = expectedResults;
+ }
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ String fileName = "../../resources/Turn_lanes_test.obf";
+
+ File fl = new File(fileName);
+
+ RandomAccessFile raf = new RandomAccessFile(fl, "r");
+
+ fe = new RoutePlannerFrontEnd(false);
+ RoutingConfiguration.Builder builder = RoutingConfiguration.getDefault();
+ Map params = new LinkedHashMap();
+ params.put("car", "true");
+ params.put("short_way", "true");
+ RoutingConfiguration config = builder.build("car", RoutingConfiguration.DEFAULT_MEMORY_LIMIT * 3, params);
+ BinaryMapIndexReader[] binaryMapIndexReaders = {new BinaryMapIndexReader(raf, fl)};
+ ctx = fe.buildRoutingContext(config, null, binaryMapIndexReaders,
+ RoutePlannerFrontEnd.RouteCalculationMode.NORMAL);
+ ctx.leftSideNavigation = false;
+ RouteResultPreparation.PRINT_TO_CONSOLE_ROUTE_INFORMATION_TO_TEST = true;
+
+ }
+
+ @Parameterized.Parameters(name = "{index}: {0}")
+ public static Collection