ein or einen?

The everyday decision: ein or einen? Ask two questions:
- Is the noun masculine (der)?
- Is it the accusative object, as in these examples?
Only if both answers are yes, you say einen: Ich esse einen Fisch — but: Ich esse ein Ei.
Trap: after sein there is no object — Das ist ein Apfel.