DependencyContainer implements Dependency { public Optional<String> getVersion() { return Optional.ofNullable(version); } DependencyContainer(String name);  DependencyContainer(String name, String version); String getName(); Optional<String> getVersion(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }
@Test public void testIsVersionPresent() { assertThat(new DependencyContainer(name, version).getVersion().isPresent(), equalTo(isVersionPresent)); }