[minor] Code formatting.
Adding unit tests to cover inner classes, generics, multiple top-level classes in the same file and class name mismatching class file name.