initial alive cells which are supposed to live up to second generation dies.
How are you trying to debug the code to see why that is happening? Try printing out the values of the variables that are used to see what is happening.
methods seem flawless to me.
instead of writing == , I've written =.