Check a Java snippet