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 java.util.Date; | |
import java.util.function.Function; | |
public class MultiParameterFunction { | |
// Bad | |
@FunctionalInterface | |
public interface TriFunction<T, U, V, R> { | |
public R customMethod(T t, U u, V v); | |
} |
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 java.util.Date; | |
import java.util.Optional; | |
public class FunctionWithCheckedException { | |
@FunctionalInterface | |
public interface SomeAppropriateSemantic<T, R> { | |
public R semantic(T t) throws CustomException; | |
}; |
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 java.util.ArrayList; | |
import java.util.List; | |
import java.util.function.Function; | |
import java.util.function.Supplier; | |
public class FormingClosure { | |
Supplier<List<String>> supplier; | |
public static void main(String[] args) { |
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 lombok.Data; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.function.Consumer; | |
import java.util.function.Supplier; | |
public class ConsumerSupplierExample { | |
public static void main(String[] args) { |
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.accolade.test; | |
import java.util.UUID; | |
public class TestUUID { | |
public static void main(String[] args) { | |
// Valid UUID | |
UUID uuid1 = UUID.fromString("123e4567-e89b-12d3-a456-426655440000"); | |
// Not a valid UUID, UUID will left pad zeros |
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.soverby.test; | |
import org.junit.Test; | |
import java.util.Optional; | |
import java.util.function.Function; | |
import static org.assertj.core.api.Java6Assertions.assertThat; | |
public class NullableChain { |
OlderNewer