PrintServiceAttributeSet set1 = new HashPrintServiceAttributeSet();
PrintServiceAttributeSet set2 = new HashPrintServiceAttributeSet(
ColorSupported.SUPPORTED);
PrintServiceAttributeSet set3 = new HashPrintServiceAttributeSet(set2);
PrinterLocation location = new PrinterLocation("room 222", Locale.ENGLISH);
PrintServiceAttribute [] arr = { location,
ColorSupported.SUPPORTED };
PrintServiceAttributeSet set4 = new HashPrintServiceAttributeSet(arr);
assertTrue(set1.isEmpty());
assertFalse(set2.isEmpty());
assertTrue(set3.equals(set2));
assertFalse(set3.equals(set1));
set3.clear();
assertEquals(set3, set1);
set3.add(ColorSupported.SUPPORTED);
set3.add(location);
assertTrue(set3.containsKey(location.getClass()));
assertFalse(set2.containsKey(MediaName.NA_LETTER_WHITE.getClass()));
assertTrue(set4.equals(set3));
assertEquals(set3.get(location.getClass()), location);
set1.addAll(set3);
assertEquals(set3, set1);
set1.remove(location.getClass());
assertEquals(set1.size(), 1);
}