public static void main(String[] args) {
        Spark.get(new Route("/fruits") {
            @Override
            public Object handle(Request request, Response response) {
                StringWriter writer = new StringWriter();
                Map<String, Object> fruits = new HashMap<String, Object>();
                fruits.put("fruits", Arrays.asList("apple", "banana", "orange", "pie", "peach"));

                Configuration configuration = new Configuration();
                configuration.setClassForTemplateLoading(SparkFormHandling.class, "/");
                try {
                    Template template = configuration.getTemplate("fruit_picker.ftl");
                    template.process(fruits, writer);
                } catch (Exception e) {
                    halt(100);
                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
                }

                return writer;
            }
        });

        Spark.post(new Route("/favourite_fruit") {
            @Override
            public Object handle(Request request, Response response) {
                String fruit = request.queryParams("fruit");
                if (fruit == null) {
                    return "You didn't choose anything, be careful.";
                } else {
                    return String.format("You chose %s. Great chose!", fruit);
                }
            }
        });
    }