### Question:
Arguments { public String description( String text ) { String wrappedText = wrapText( text, LINE_LENGTH ); if ( namedArgs.isEmpty() ) { return wrappedText; } wrappedText = String.join( NEWLINE + NEWLINE, wrappedText, "options:" ); final int alignLength = namedArgs.values().stream() .map( a -> a.optionsListing().length() ) .reduce( 0, Integer::max ); return String.join( NEWLINE, wrappedText, namedArgs.values().stream() .map( c -> formatArgumentDescription( alignLength, c ) ) .collect( Collectors.joining( NEWLINE ) ) ); } Arguments(); Arguments withDatabase(); Arguments withDatabase( String description ); Arguments withAdditionalConfig(); Arguments withTo( String description ); Arguments withOptionalPositionalArgument( int position, String value ); Arguments withMandatoryPositionalArgument( int position, String value ); Arguments withArgument( NamedArgument namedArgument ); Arguments withPositionalArgument( PositionalArgument arg ); String usage(); String description( String text ); static String wrapText( final String text, final int lineLength ); String formatArgumentDescription( final int longestAlignmentLength, final NamedArgument argument ); static String rightColumnFormatted( final String leftText, final String rightText, int rightAlignIndex ); Arguments parse( String[] args ); String get( int pos ); String get( String argName ); boolean getBoolean( String argName ); Optional<Path> getOptionalPath( String argName ); Path getMandatoryPath( String argName ); T get( String argName, Function<String,T> converter ); boolean has( String argName ); static final Arguments NO_ARGS; }### Answer:
@Test void descriptionShouldHandleExistingNewlines() { assertEquals( String.format( "This is the first line%n" + "And this is the second line%n" + "The third line is so long that it requires some wrapping by the code itself%n" + "because as you can see it just keeps going ang going and going and going and%n" + "going and going." ), builder.description( String.format( "This is the first line%n" + "And this is the second line%n" + "The third line is so long that it requires some wrapping by the code itself because " + "as you " + "can see it just keeps going ang going and going and going and going and going." ) ) ); }