| 50 | } |
| 51 | |
| 52 | class NamedBrowser implements Browser { |
| 53 | private final String name; |
| 54 | private final Set<String> otherNames; |
| 55 | |
| 56 | protected NamedBrowser(String name, String... otherNames) { |
| 57 | this.name = Require.nonNull("Browser name", name); |
| 58 | this.otherNames = Set.of(otherNames); |
| 59 | } |
| 60 | |
| 61 | @Override |
| 62 | public boolean is(String browserName) { |
| 63 | return Browser.super.is(browserName) || otherNames.contains(browserName); |
| 64 | } |
| 65 | |
| 66 | @Override |
| 67 | public String browserName() { |
| 68 | return name; |
| 69 | } |
| 70 | |
| 71 | @Override |
| 72 | public final String toString() { |
| 73 | return name; |
| 74 | } |
| 75 | } |
nothing calls this directly
no outgoing calls
no test coverage detected