You are here: Home Demos Lecture 22 TestJpf.java

TestJpf.java

Python Source icon TestJpf.java — Python Source, 422 bytes

File contents

import gov.nasa.jpf.vm.Verify;

public class TestJpf {
    public static void main(String[] param) {
	PriorityQueue pq = new Heap();
	while (true) {
	    if (true || Verify.getBoolean()) {
		int value = Verify.getInt(0,1);
		System.out.println("Putting: "+value);
		pq.enqueue(new Integer(value));
	    } else if (!pq.isEmpty()) {
		Comparable f = pq.removeFirst();
		System.out.println("Removing: "+f);
	    }
	}
    }
}