This file contains 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 br.com.uol.ps.so.api; | |
import java.util.ArrayList; | |
import java.util.List; | |
import lombok.AllArgsConstructor; | |
import lombok.Data; | |
/** | |
* @author Julio Falbo |
This file contains 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.tradeshift.juliofalbo.challenge.tradeshift.test; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.List; | |
public class BTreePrinter { | |
public static <T extends Comparable<?>> void printNode(Node root) { | |
int maxLevel = BTreePrinter.maxLevel(root); |
This file contains 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.beans.FeatureDescriptor; | |
import java.util.Objects; | |
import java.util.stream.Stream; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.beans.BeanUtils; | |
import org.springframework.beans.BeanWrapper; | |
import org.springframework.beans.BeanWrapperImpl; |
This file contains 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.julio.poc.aync.config; | |
import static java.util.stream.Collectors.groupingBy; | |
import static org.springframework.beans.factory.config.BeanDefinition.SCOPE_SINGLETON; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Objects; | |
import java.util.Optional; |
This file contains 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
interface SomeInterfaceJava8 { | |
Integer customCalc(int a, int b); | |
default Integer calc(int a, int b) { | |
return (a + b); | |
} | |
} | |
class SomeImplementationJava8 implements SomeInterfaceJava8 { | |
@Override | |
public Integer customCalc(int a, int b) { |
This file contains 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
interface OneInterface { | |
default void defaultMethod(){ | |
System.out.println("One"); | |
} | |
} | |
interface TwoInterface { | |
default void defaultMethod(){ | |
System.out.println("Two"); | |
} |
This file contains 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
public class FunctionalProgramming { | |
public static void main(String[] args) { | |
calc((a, b) -> a + b); | |
} | |
public static void calc(FunctionInterface functionInterface) { | |
Integer result = functionInterface.add(2, 2); | |
System.out.println(result); | |
} |
This file contains 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
public class StaticMethods { | |
public static void main(String[] args) { | |
InterfaceWithStaticMethod impl1 = (text) -> System.out.println("Custom Message " + text); | |
impl1.printWithCustomMessage("Text"); | |
InterfaceWithStaticMethod.print("Text"); | |
} | |
} | |
interface InterfaceWithStaticMethod { | |
void printWithCustomMessage(String text); |
This file contains 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
interface ConcatStringInterface { | |
String concat(String param1, String param2); | |
} | |
class ConcatStringImpl implements ConcatStringInterface { | |
public String concat(String param1, String param2) { | |
return param1 + param2; | |
} | |
} |
This file contains 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
@FunctionalInterface | |
public interface FunctionalI { | |
void abstractMethod(); | |
default String defaultMethod() { | |
return "defaultMethod"; | |
} | |
static String staticMethod() { | |
return "staticMethod"; |
OlderNewer