### Question:
DurationValue extends ScalarValue implements TemporalAmount, Comparable<DurationValue> { public static DurationValue parse( CharSequence text ) { return TemporalValue.parse( DurationValue.class, PATTERN, DurationValue::parse, text ); } private  DurationValue( long months, long days, long seconds, long nanos ); static DurationValue duration( Duration value ); static DurationValue duration( Period value ); static DurationValue duration( long months, long days, long seconds, long nanos ); static DurationValue parse( CharSequence text ); static DurationValue parse( TextValue text ); static DurationValue build( MapValue map ); static DurationValue between( TemporalUnit unit, Temporal from, Temporal to ); @Override int compareTo( DurationValue other ); @Override boolean equals( Value other ); @Override void writeTo( ValueWriter<E> writer ); @Override TemporalAmount asObjectCopy(); @Override String toString(); @Override String getTypeName(); @Override String prettyPrint(); @Override ValueGroup valueGroup(); @Override NumberType numberType(); @Override long updateHash( HashFunction hashFunction, long hash ); @Override T map( ValueMapper<T> mapper ); @Override long get( TemporalUnit unit ); LongValue get( String fieldName ); @Override List<TemporalUnit> getUnits(); DurationValue plus( long amount, TemporalUnit unit ); @Override Temporal addTo( Temporal temporal ); @Override Temporal subtractFrom( Temporal temporal ); DurationValue add( DurationValue that ); DurationValue sub( DurationValue that ); DurationValue mul( NumberValue number ); DurationValue div( NumberValue number ); static DurationValue approximate( double months, double days, double seconds, double nanos ); static final DurationValue MIN_VALUE; static final DurationValue MAX_VALUE; static final DurationValue ZERO; }### Answer:
@Test void shouldNotParseInvalidDurationStrings() { assertThrows( TemporalParseException.class, () -> parse( "" ) ); assertThrows( TemporalParseException.class, () -> parse( "P" ) ); assertThrows( TemporalParseException.class, () -> parse( "PT" ) ); assertThrows( TemporalParseException.class, () -> parse( "PT.S" ) ); assertThrows( TemporalParseException.class, () -> parse( "PT,S" ) ); assertThrows( TemporalParseException.class, () -> parse( "PT.0S" ) ); assertThrows( TemporalParseException.class, () -> parse( "PT,0S" ) ); assertThrows( TemporalParseException.class, () -> parse( "PT0.S" ) ); assertThrows( TemporalParseException.class, () -> parse( "PT0,S" ) ); assertThrows( TemporalParseException.class, () -> parse( "PT1,-1S" ) ); assertThrows( TemporalParseException.class, () -> parse( "PT1.-1S" ) ); for ( String s : new String[]{"Y", "M", "W", "D"} ) { assertThrows( TemporalParseException.class, () -> parse( "P-" + s ) ); assertThrows( TemporalParseException.class, () -> parse( "P1" + s + "T" ) ); } for ( String s : new String[]{"H", "M", "S"} ) { assertThrows( TemporalParseException.class, () -> parse( "PT-" + s ) ); assertThrows( TemporalParseException.class, () -> parse( "T1" + s ) ); } }