@Test public void toXmlAndBackAgainShouldProduceSameOption() throws Exception { assertEquals(optionTrue, new Option(optionTrue.asXML(), 1)); assertEquals(optionFalse, new Option(optionFalse.asXML(), 2)); }
public Element asXML() { ReadableElement element = new ReadableElement(XML_TAG_OPTION); element.setAttribute(XML_ATTRIBUTE_CORRECT, Boolean.toString(correct)); element.setText(optionText); return element; }
Option implements Serializable { public Element asXML() { ReadableElement element = new ReadableElement(XML_TAG_OPTION); element.setAttribute(XML_ATTRIBUTE_CORRECT, Boolean.toString(correct)); element.setText(optionText); return element; } }
Option implements Serializable { public Element asXML() { ReadableElement element = new ReadableElement(XML_TAG_OPTION); element.setAttribute(XML_ATTRIBUTE_CORRECT, Boolean.toString(correct)); element.setText(optionText); return element; } Option(String optionText, boolean correct, int id);  Option(Element element, int id); }
Option implements Serializable { public Element asXML() { ReadableElement element = new ReadableElement(XML_TAG_OPTION); element.setAttribute(XML_ATTRIBUTE_CORRECT, Boolean.toString(correct)); element.setText(optionText); return element; } Option(String optionText, boolean correct, int id);  Option(Element element, int id); Element asXML(); String getOptionText(); boolean isCorrect(); int getId(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
Option implements Serializable { public Element asXML() { ReadableElement element = new ReadableElement(XML_TAG_OPTION); element.setAttribute(XML_ATTRIBUTE_CORRECT, Boolean.toString(correct)); element.setText(optionText); return element; } Option(String optionText, boolean correct, int id);  Option(Element element, int id); Element asXML(); String getOptionText(); boolean isCorrect(); int getId(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }