RangeTypeMaskPersistableSpi implements DimapPersistableSpi { @Override public boolean canDecode(Element element) { final String type = element.getAttributeValue(DimapProductConstants.ATTRIB_TYPE); return Mask.RangeType.TYPE_NAME.equals(type); }  @Override boolean canDecode(Element element); @Override boolean canPersist(Object object); @Override DimapPersistable createPersistable();  }
@Test public void testCanDecode_GoodElement() throws JDOMException, IOException { final InputStream resourceStream = getClass().getResourceAsStream("RangeMask.xml"); final Document document = new SAXBuilder().build(resourceStream); assertTrue(_persistableSpi.canDecode(document.getRootElement())); }
@Test public void testCanDecode_NotDecodeableElement() { final Element element = new Element("SomeWhat"); assertFalse(_persistableSpi.canDecode(element)); }