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
private Map<Integer,? extends Address> getAddressIndex(Optional<SubjectData> currentSubjectData) { | |
return currentSubjectData | |
.map(subjectData -> subjectData | |
.getAddresses() | |
.stream() | |
.filter(address -> address.getEsoId() != null) | |
.collect(toMap(Address::getEsoId, t -> t)) | |
) | |
.orElse(emptyMap()) | |
; |
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.util.stream.Stream; | |
import static java.util.stream.Collectors.toList; | |
import java.util.List; | |
import java.util.Arrays; | |
import com.google.common.collect.Lists; | |
// javac -classpath c:\java\m2\repository\com\google\guava\guava\17.0\guava-17.0.jar X.java | |
// java -classpath .;c:\java\m2\repository\com\google\guava\guava\17.0\guava-17.0.jar X | |
public class X { |
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 anno; | |
import java.lang.annotation.ElementType; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
import java.lang.annotation.Target; | |
import java.lang.reflect.AnnotatedArrayType; | |
import java.lang.reflect.AnnotatedParameterizedType; | |
import java.lang.reflect.AnnotatedType; | |
import java.lang.reflect.Field; |
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 anno; | |
import static java.util.stream.Collectors.toList; | |
import java.lang.annotation.ElementType; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
import java.lang.annotation.Target; | |
import java.lang.reflect.AnnotatedArrayType; | |
import java.lang.reflect.AnnotatedElement; |
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.io.IOException; | |
import org.apache.logging.log4j.core.appender.AbstractManager; | |
import org.apache.logging.log4j.core.appender.rolling.DefaultRolloverStrategy; | |
import org.apache.logging.log4j.core.appender.rolling.RollingFileManager; | |
import org.apache.logging.log4j.core.appender.rolling.RolloverDescription; | |
import org.apache.logging.log4j.core.appender.rolling.RolloverDescriptionImpl; | |
import org.apache.logging.log4j.core.appender.rolling.RolloverStrategy; | |
import org.apache.logging.log4j.core.appender.rolling.action.AbstractAction; | |
import org.apache.logging.log4j.core.appender.rolling.action.Action; |
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.lang.reflect.*; | |
import java.util.*; | |
import java.lang.annotation.ElementType; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
import java.lang.annotation.Target; | |
public class AnnotationOnTypeArgument { |
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 com.google.common.collect.*; | |
import java.util.HashSet; | |
import java.util.Map; | |
import java.util.Set; | |
import static com.google.common.collect.ImmutableSet.toImmutableSet; | |
import static java.util.stream.Collectors.*; | |
public class Mapping { |
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
javascript:(function(){Array.from(document.getElementsByTagName("textarea")).forEach(function(el){el.parentNode.style.display='block';el.parentNode.style.position='relative';el.parentNode.parentNode.previousElementSibling.style.width='40px';});})(); |
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 sun.misc.*; | |
public class Main { | |
public static void main(String[] args) { | |
Signal signal = new Signal("USR2"); | |
System.out.println(signal); | |
} | |
} |
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 com.fasterxml.jackson.core.JsonProcessingException; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import com.fasterxml.jackson.databind.SerializationFeature; | |
import com.fasterxml.jackson.datatype.joda.JodaModule; | |
import org.joda.time.LocalDate; | |
public class Main { | |
static class Foo { | |
String name; |
OlderNewer