They are different. In Code:1, each object of the class that code is contained in has their own objects t and t1, while in Code:2, there is only one object t and one object t1, both of which are shared between all objects of that class.
This has created three instances of Test. a.testNonStatic and b.testNonStatic are two of them. a.testStatic and b.testStatic refer to the same object, which is the third. In practice, because testStatic is shared, you should never refer to it like this. Instead refer to StaticTest.testStatic.