Skip to content

Instantly share code, notes, and snippets.

View JosePaumard's full-sized avatar

José Paumard JosePaumard

View GitHub Profile
package org.paumard.jldd;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.*;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import java.util.*;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import java.util.*;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Stream;
import static java.util.stream.Collectors.*;
import org.eclipse.collections.api.stack.primitive.ImmutableCharStack;
import org.eclipse.collections.impl.block.factory.primitive.CharPredicates;
import org.eclipse.collections.impl.factory.Strings;
import org.eclipse.collections.impl.factory.primitive.CharStacks;
import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.runner.Runner;
import org.openjdk.jmh.runner.RunnerException;
import org.openjdk.jmh.runner.options.Options;
import org.openjdk.jmh.runner.options.OptionsBuilder;
import org.assertj.core.api.SoftAssertions;
import org.eclipse.collections.api.bag.Bag;
import org.eclipse.collections.api.list.MutableList;
import org.eclipse.collections.api.multimap.list.ListMultimap;
import org.eclipse.collections.impl.factory.Lists;
import org.junit.Before;
import org.junit.Test;
import java.util.Map;
import java.util.stream.Collectors;
import org.assertj.core.api.Assertions;
import org.eclipse.collections.api.bag.primitive.CharBag;
import org.eclipse.collections.impl.factory.Strings;
import org.junit.Test;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
public LocationDetails updateWithLocation(JsonObject location) {
setCity(location.getValue("/data/city_name").toString());
setCountry(location.getValue("/data/country_name").toString());
return this;
}
public void getJson(@Suspended final AsyncResponse async) throws NoSuchAlgorithmException, KeyManagementException {
Client client = getUnsecureClient();
LocationDetails locDetails = new LocationDetails();
CompletionStage<JsonObject> cfIp = client.target("http://api.ipify.org/")
.queryParam("format", "json")
.request()
.rx()
@JosePaumard
JosePaumard / JMHRunner.java
Created March 23, 2017 08:46
Runner for JMH with a modified output
import org.junit.runners.model.InitializationError;
import org.openjdk.jmh.results.IterationResult;
import org.openjdk.jmh.results.RunResult;
import org.openjdk.jmh.runner.Runner;
import org.openjdk.jmh.runner.RunnerException;
import org.openjdk.jmh.runner.options.Options;
import java.util.Collection;
import java.util.Comparator;
package org.paumard.movies.model;
import java.util.HashSet;
import java.util.Set;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;