@Test
public void writeOptional()
                        throws XMLStreamException {

    final String frame = "http://my.big.org/TRS/calendars/japanese";
    final String calendarEraName = "Meiji";
    final IndeterminateValue indeterminatePosition = BEFORE;
    final String value = "0025-03";
    final TimePosition timePosition = new TimePosition( frame, calendarEraName, indeterminatePosition, value );
    final MemoryXmlStreamWriter xmlWriter = new MemoryXmlStreamWriter();
    xmlWriter.writeStartElement( "TimePosition" );
    gmlTimePositionTypeWriter.write( timePosition, xmlWriter );
    xmlWriter.writeEndElement();
    assertEquals( "<TimePosition frame=\"http://my.big.org/TRS/calendars/japanese\" calendarEraName=\"Meiji\" indeterminatePosition=\"before\">0025-03</TimePosition>",
                  xmlWriter.getOutput() );
}