/*
  * printerStateReasonSet(Severity severity) method testing.
  */
 public final void testPrinterStateReasonSet() {
   reasons = new PrinterStateReasons();
   reasons.put(PrinterStateReason.MEDIA_LOW, Severity.ERROR);
   HashSet set = new HashSet();
   set.add(PrinterStateReason.MEDIA_LOW);
   assertEquals(set, reasons.printerStateReasonSet(Severity.ERROR));
   set = new HashSet();
   assertEquals(set, reasons.printerStateReasonSet(Severity.REPORT));
 }
  /*
   * printerStateReasonSet(Severity severity) method testing.
   */
  public final void testPrinterStateReasonSet1() {
    reasons = new PrinterStateReasons();
    reasons.put(PrinterStateReason.COVER_OPEN, Severity.ERROR);
    reasons.put(PrinterStateReason.MEDIA_LOW, Severity.WARNING);
    reasons.put(PrinterStateReason.DOOR_OPEN, Severity.ERROR);
    reasons.put(PrinterStateReason.INPUT_TRAY_MISSING, Severity.ERROR);

    Set set = reasons.printerStateReasonSet(Severity.ERROR);
    try {
      set.iterator().remove();
      fail("Unmodifiable set was changed");
    } catch (UnsupportedOperationException e) {
    }

    try {
      set.add(PrinterStateReason.COVER_OPEN);
      fail("Unmodifiable set was changed");
    } catch (UnsupportedOperationException e) {

    }
  }
 /**
  * {@collect.stats} Construct a new printer state reasons attribute that contains the same {@link
  * PrinterStateReason PrinterStateReason}-to-{@link Severity Severity} mappings as the given map.
  * The underlying hash map's initial capacity and load factor are as specified in the superclass
  * constructor {@link java.util.HashMap#HashMap(java.util.Map) <CODE>HashMap(Map)</CODE>}.
  *
  * @param map Map to copy.
  * @exception NullPointerException (unchecked exception) Thrown if <CODE>map</CODE> is null or if
  *     any key or value in <CODE>map</CODE> is null.
  * @throws ClassCastException (unchecked exception) Thrown if any key in <CODE>map</CODE> is not
  *     an instance of class {@link PrinterStateReason PrinterStateReason} or if any value in
  *     <CODE>map</CODE> is not an instance of class {@link Severity Severity}.
  */
 public PrinterStateReasons(Map<PrinterStateReason, Severity> map) {
   this();
   for (Map.Entry<PrinterStateReason, Severity> e : map.entrySet()) put(e.getKey(), e.getValue());
 }