This is a TCK check. A call to EntityManagerFactory#getMetamodel should result in a IllegalStateException if the EntityManagerFactory is closed.