I want to convert this JSON:
{
    "ab.g": "foo2",
    "ab.cd.f": "bar",
    "ab.cd.e": "foo"
}
to this:
{
   "ab": {
      "cd": {
         "e": "foo",
         "f": "bar"
      },
      "g": "foo2"
   }
}
I have found this: Convert javascript dot notation object to nested object but the accepted answer on this post has some language specific syntax and I am not able to rewrite the same logic in Java.
Note: There is no attempt in the question because I have answered this myself - because there is no such question on stackoverflow for Java specifically.
