public static void printerTest() {
        DocFlavor myFormat = DocFlavor.SERVICE_FORMATTED.PRINTABLE;
        PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();

        PrintService[] printers = PrintServiceLookup.lookupPrintServices(myFormat, aset);

        for (PrintService printService : printers) {
            PrintServiceAttributeSet attributes = printService.getAttributes();
            String printerState = attributes.get(PrinterState.class).toString();
            String printerStateReason = attributes.get(PrinterStateReason.class).toString();

            System.out.println("printerState = " + printerState); // May be IDLE, PROCESSING, STOPPED or UNKNOWN
            System.out.println("printerStateReason = " + printerStateReason); // If your jna state returns STOPPED, for example, you can identify the reason

            if (printerState.equals(PrinterState.STOPPED.toString())) {

                if (printerStateReason.equals(PrinterStateReason.TONER_LOW.toString())) {

                    System.out.println("Toner level is low.");
                }
            }
        }
    }