这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@sk1418
Copy link
Contributor

@sk1418 sk1418 commented Mar 3, 2025

No description provided.


interface MyInterface {
default String extractFirstLetters(List<String> words) {
return String.join(", ", words.stream().map(str -> str.substring(0, 1)).toList());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's apply the mulltiline formatter style for the chained method calls

void whenUseAnyWithListClass_thenCorrect() {
MyInterface mock = Mockito.mock(MyInterface.class);
when(mock.extractFirstLetters(any(List.class))).thenReturn("a, b, c, d, e");
assertEquals("a, b, c, d, e", mock.extractFirstLetters(new ArrayList<String>()));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assertEquals("a, b, c, d, e", mock.extractFirstLetters(new ArrayList<String>()));
assertEquals("a, b, c, d, e", mock.extractFirstLetters(new ArrayList<>()));

@theangrydev theangrydev merged commit b8badb9 into eugenp:master Mar 9, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants