Geneic stack using IntelliJ - null pointer