Created
April 16, 2019 20:00
-
-
Save jnizet/9f882dc1c462b616a34211f3b3a62273 to your computer and use it in GitHub Desktop.
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.Arrays; | |
import java.util.Collections; | |
import java.util.HashSet; | |
import java.util.Set; | |
public class InterfaceTest { | |
interface TestInterface { | |
default Set<String> getRequiredStrings() { | |
return Collections.emptySet(); | |
} | |
} | |
static class B implements TestInterface {} | |
static class C extends B {} | |
static class D extends C { | |
@Override | |
public Set<String> getRequiredStrings() { | |
return new HashSet<>(Arrays.asList("Not an empty set")); | |
} | |
} | |
public static void main(String[] args) { | |
TestInterface d = new D(); | |
System.out.println("d.getRequiredStrings() = " + d.getRequiredStrings()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
`public class InterfaceTest {
}`