functionalize check for java