BundleToken implements Token { @Override public Collection<LogEntryValue> getRequiredLogEntryValues() { Collection<LogEntryValue> values = EnumSet.noneOf(LogEntryValue.class); for (Token token : tokens) { values.addAll(token.getRequiredLogEntryValues()); } return values; } BundleToken(final Collection<Token> tokens); @Override Collection<LogEntryValue> getRequiredLogEntryValues(); @Override void render(final LogEntry logEntry, final StringBuilder builder); @Override void apply(final LogEntry logEntry, final PreparedStatement statement, final int index);  }
@Test public void requiredLogEntryValues() { BundleToken token = new BundleToken(asList(new PackageNameToken(), new SeverityLevelToken())); assertThat(token.getRequiredLogEntryValues()).containsOnly(LogEntryValue.CLASS, LogEntryValue.LEVEL); }