Java Void Function Object Is Not Subscriptable