Change AssertionError to IllegalStateException