Somewhere inside your MAIN method, you need to say TestType = something, as the code you've shown us means its null.
Type: Posts; User: newbie
Somewhere inside your MAIN method, you need to say TestType = something, as the code you've shown us means its null.
Comparing two Objects which have been assigned String values work fine. The problem is reading your code.
public static void main(String[] args) {
TestType.toString();
...
Until you show us the exact values both variables hold before you do the equality test, we cannot help you.
It is going into the else clause because your TestType object is not the same as name1. This is expected behaviour.