@@ -173,4 +173,73 @@ void shouldBeImmutableAfterBuild() {
173173			.isInstanceOf (UnsupportedOperationException .class );
174174	}
175175
176+ 	@ Test 
177+ 	void  shouldHandleNullStopSequences () {
178+ 		ChatOptions  options  = this .builder .model ("test-model" ).stopSequences (null ).build ();
179+ 
180+ 		assertThat (options .getStopSequences ()).isNull ();
181+ 	}
182+ 
183+ 	@ Test 
184+ 	void  shouldHandleEmptyStopSequences () {
185+ 		ChatOptions  options  = this .builder .model ("test-model" ).stopSequences (List .of ()).build ();
186+ 
187+ 		assertThat (options .getStopSequences ()).isEmpty ();
188+ 	}
189+ 
190+ 	@ Test 
191+ 	void  shouldHandleFrequencyAndPresencePenalties () {
192+ 		ChatOptions  options  = this .builder .model ("test-model" ).frequencyPenalty (0.5 ).presencePenalty (0.3 ).build ();
193+ 
194+ 		assertThat (options .getFrequencyPenalty ()).isEqualTo (0.5 );
195+ 		assertThat (options .getPresencePenalty ()).isEqualTo (0.3 );
196+ 	}
197+ 
198+ 	@ Test 
199+ 	void  shouldMaintainStopSequencesOrder () {
200+ 		List <String > orderedSequences  = List .of ("first" , "second" , "third" , "fourth" );
201+ 
202+ 		ChatOptions  options  = this .builder .model ("test-model" ).stopSequences (orderedSequences ).build ();
203+ 
204+ 		assertThat (options .getStopSequences ()).containsExactly ("first" , "second" , "third" , "fourth" );
205+ 	}
206+ 
207+ 	@ Test 
208+ 	void  shouldCreateIndependentCopies () {
209+ 		ChatOptions  original  = this .builder .model ("test-model" )
210+ 			.stopSequences (new  ArrayList <>(List .of ("stop1" )))
211+ 			.build ();
212+ 
213+ 		ChatOptions  copy1  = original .copy ();
214+ 		ChatOptions  copy2  = original .copy ();
215+ 
216+ 		assertThat (copy1 ).isNotSameAs (copy2 );
217+ 		assertThat (copy1 .getStopSequences ()).isNotSameAs (copy2 .getStopSequences ());
218+ 		assertThat (copy1 ).usingRecursiveComparison ().isEqualTo (copy2 );
219+ 	}
220+ 
221+ 	@ Test 
222+ 	void  shouldHandleSpecialStringValues () {
223+ 		ChatOptions  options  = this .builder .model ("" ) // Empty string 
224+ 			.stopSequences (List .of ("" , "  " , "\n " , "\t " ))
225+ 			.build ();
226+ 
227+ 		assertThat (options .getModel ()).isEmpty ();
228+ 		assertThat (options .getStopSequences ()).containsExactly ("" , "  " , "\n " , "\t " );
229+ 	}
230+ 
231+ 	@ Test 
232+ 	void  shouldPreserveCopyIntegrity () {
233+ 		List <String > mutableList  = new  ArrayList <>(List .of ("original" ));
234+ 		ChatOptions  original  = this .builder .model ("test-model" ).stopSequences (mutableList ).build ();
235+ 
236+ 		// Modify the original list after building 
237+ 		mutableList .add ("modified" );
238+ 
239+ 		ChatOptions  copy  = original .copy ();
240+ 
241+ 		assertThat (original .getStopSequences ()).containsExactly ("original" );
242+ 		assertThat (copy .getStopSequences ()).containsExactly ("original" );
243+ 	}
244+ 
176245}
0 commit comments