- Blog - When to use parallel streams?
- Blog - Sequential vs Parallel vs Concurrent
- Blog - Nested Parallel Streams more concurrency less performance
- Blob - Why your parallel stream might not be parallel at all
- Blog - Synchronous vs Asynchronous
- Blog - Virtual thread with Spring boot
- Video - Java 24 Stops Pinning Virtual Threads (Almost) - Inside Java Newscast #80
- [Blog - Netflix blog: Dude where's my lock?](https://netflixtechblog.com/java-21-virt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.hugodesmarques.threads; | |
| import java.util.concurrent.*; | |
| public class ThreadPoolsOOMExample { | |
| private static final int THREAD_POOL_SIZE = 10; | |
| private static final int TOTAL_TASKS = 1_000_000; | |
| private final ExecutorService mainExecutor = Executors.newFixedThreadPool(THREAD_POOL_SIZE); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package io.github.CarolinaCedro.POC01.application.service.impl; | |
| import io.github.CarolinaCedro.POC01.config.modelMapper.ModelMapperConfig; | |
| import io.github.CarolinaCedro.POC01.domain.entities.Address; | |
| import io.github.CarolinaCedro.POC01.infra.repository.AddressRepository; | |
| import org.junit.jupiter.api.Assertions; | |
| import org.junit.jupiter.api.BeforeEach; | |
| import org.junit.jupiter.api.Test; | |
| import org.mockito.InjectMocks; | |
| import org.mockito.Mock; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let regex; | |
| /* matching a specific string */ | |
| regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello" | |
| regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO" | |
| regex = /hello/g; // looks for multiple occurrences of string between the forward slashes... | |
| /* wildcards */ | |
| regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo" | |
| regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.hugodesmarques.assertJ; | |
| import com.google.common.collect.ImmutableMap; | |
| import org.apache.commons.lang3.SerializationUtils; | |
| import org.junit.Test; | |
| import static org.assertj.core.api.Assertions.assertThat; | |
| /** | |
| * Samples how to use AssertJ to test a Map. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.fasterxml.jackson.databind.ObjectMapper; | |
| import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; | |
| import lombok.Getter; | |
| import lombok.Setter; | |
| import lombok.ToString; | |
| import java.io.IOException; | |
| import java.time.Instant; | |
| import java.time.LocalDate; | |
| import java.time.LocalDateTime; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.hugodesmarques; | |
| import org.springframework.boot.SpringApplication; | |
| import org.springframework.boot.autoconfigure.SpringBootApplication; | |
| @SpringBootApplication | |
| public class DemoApplication { | |
| public static void main(String[] args) { | |
| SpringApplication.run(DemoApplication.class, args); |