import javax.print.PrintService;
import javax.print.PrintServiceLookup;
import javax.print.attribute.HashAttributeSet;
import javax.print.attribute.standard.PrinterName;

public class PrintServiceLookupTest {
	public static void main(String[] args) {
		HashAttributeSet attributes = new HashAttributeSet();
		attributes.add(new PrinterName("phantom-printer", null));
		PrintService[] printServices = PrintServiceLookup.lookupPrintServices(null, attributes);
		if (printServices.length == 0) {
			System.out.println("Test PASSED");
		} else {
			throw new RuntimeException("NOK '" + printServices[0] + "' should not be found");
		}
	}
}
