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 interface AB extends A { | |
String bar(); | |
} |
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 interface A { | |
String foo(); | |
} |
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 abstract class ABFactory { | |
private ABFactory() { /* prevent instantiation */ } | |
public static AB createAB(A a) { | |
B b = new BImpl(a); | |
return (AB) Proxy.newProxyInstance(a.getClass().getClassLoader(), | |
new Class[]{AB.class}, (proxy, method, args) -> { | |
Class<?>[] declaringClassInterfaces = method.getDeclaringClass().getInterfaces(); | |
List<Class<?>> interfaces = new ArrayList<>(Arrays.asList(declaringClassInterfaces)); | |
interfaces.add(method.getDeclaringClass()); |
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
GET /trust/official.json HTTP/1.1 | |
Host: dvjy3tqbc323p.cloudfront.net | |
User-Agent: Go 1.1 package http | |
Accept-Encoding: gzip | |