SimpleProgressCheck implements ProgressCheck { @NotNull protected String getString(@NotNull final String key) { return Optional.ofNullable(getResourceBundle()) .filter(bundle -> bundle.containsKey(key)) .map(bundle -> bundle.getString(key)) .orElse(key); }  @Override void setResourceBundle(final ResourceBundle resourceBundle); @Override void startedScan(); @Override Collection<Violation> getReportedViolations();  }
@Test public void testGetString() { final SimpleProgressCheck check = new SimpleProgressCheck(); assertEquals("expect passthrough", "testKey", check.getString("testKey")); ResourceBundle newBundle = ResourceBundle.getBundle(getClass().getName()); check.setResourceBundle(newBundle); assertEquals("expect from bundle", "yeKtset", check.getString("testKey")); }