Skip to content

Commit fe4c932

Browse files
committed
commit everything
1 parent 0e0fc47 commit fe4c932

8 files changed

Lines changed: 148 additions & 171 deletions

File tree

algorithms/FrequencyOfLetters/.idea/workspace.xml

Lines changed: 98 additions & 171 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

algorithms/FrequencyOfLetters/src/com/azaharia/facotrypattern/Main.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,22 @@ public static void main(String[] args) {
4848
}*/
4949
B b = new B();
5050
b.test();
51+
52+
GenericHolder<String> foo = new GenericHolder<>(1l);
53+
System.out.println(foo.getObject());
54+
}
55+
private static class GenericHolder<T> {
56+
private T object;
57+
58+
public GenericHolder(Object object) {
59+
this.object = (T) object;
60+
System.out.println(getObject());
61+
}
62+
63+
public T getObject() {
64+
return object;
65+
}
5166
}
5267
}
68+
69+

practice-spring-boot/reactivespring-and-nflow/src/test/java/com/zahariaca/reactivespringandnflow/MapFromYamlIntegrationTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.zahariaca.reactivespringandnflow;
22

33
import com.zahariaca.reactivespringandnflow.config.TestProperties;
4+
import org.junit.jupiter.api.BeforeAll;
45
import org.junit.jupiter.api.Test;
56
import org.junit.jupiter.api.extension.ExtendWith;
67
import org.springframework.beans.factory.annotation.Autowired;
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
package com.zahariaca.learnreactivespring.repository;
22

33
import com.zahariaca.learnreactivespring.document.Item;
4+
import org.springframework.data.domain.Pageable;
45
import org.springframework.data.mongodb.repository.ReactiveMongoRepository;
56
import reactor.core.publisher.Mono;
67

78
public interface ItemReactiveRepository extends ReactiveMongoRepository<Item, String> {
89

910
Mono<Item> findByDescription(String description);
11+
12+
Flux<Item> findAllByIdNotNullOrderByIdAsc(final Pageable page);
1013
}

udemy/restful-apis-with-webflux/learn-reactivespring/src/test/java/com/zahariaca/learnreactivespring/controller/v1/ItemControllerTest.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import com.zahariaca.learnreactivespring.document.Item;
44
import com.zahariaca.learnreactivespring.repository.ItemReactiveRepository;
5+
import lombok.Builder;
6+
import lombok.Data;
57
import org.junit.jupiter.api.BeforeEach;
68
import org.junit.jupiter.api.Test;
79
import org.junit.jupiter.api.extension.ExtendWith;
@@ -16,6 +18,8 @@
1618
import reactor.test.StepVerifier;
1719

1820
import java.util.List;
21+
import java.util.function.Function;
22+
import java.util.stream.Collectors;
1923

2024
import static com.zahariaca.learnreactivespring.constants.ItemConstants.ITEM_END_POINT_V1;
2125
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -161,4 +165,29 @@ void runtimeException() {
161165
.expectBody(String.class)
162166
.isEqualTo("RuntimeException occurred");
163167
}
168+
169+
@Data
170+
@Builder
171+
static class TestObject {
172+
int id;
173+
String value;
174+
}
175+
176+
@Test
177+
void name() {
178+
List<TestObject> list = List.of(
179+
TestObject.builder()
180+
.id(1)
181+
.value("one")
182+
.build(),
183+
TestObject.builder()
184+
.id(2)
185+
.value("two")
186+
.build()
187+
);
188+
189+
list.stream()
190+
.collect(Collectors.toMap(TestObject::getId, Function.identity()))
191+
.forEach((k,v) -> System.out.println("key " + k +" " + v));
192+
}
164193
}

0 commit comments

Comments
 (0)