@Test public void shouldReturnEmptyOptionalForUnknownObject() { Object unknownObject = "example unknown object"; Optional<UUID> id = cut.getId(unknownObject); assertThat(id.isPresent()).isFalse(); }
public Optional<UUID> getId(final Object object) { return Optional.ofNullable(objectToId.get(object)); }
WeakObjectRegistry { public Optional<UUID> getId(final Object object) { return Optional.ofNullable(objectToId.get(object)); } }
WeakObjectRegistry { public Optional<UUID> getId(final Object object) { return Optional.ofNullable(objectToId.get(object)); }  }
WeakObjectRegistry { public Optional<UUID> getId(final Object object) { return Optional.ofNullable(objectToId.get(object)); }  Optional<Object> getById(final UUID id); Object getByIdOrFail(final UUID id); Optional<UUID> getId(final Object object); UUID getIdOrFail(final Object object); UUID registerIfUnknown(final Object object); void registerObject(final Object object, final UUID id); }
WeakObjectRegistry { public Optional<UUID> getId(final Object object) { return Optional.ofNullable(objectToId.get(object)); }  Optional<Object> getById(final UUID id); Object getByIdOrFail(final UUID id); Optional<UUID> getId(final Object object); UUID getIdOrFail(final Object object); UUID registerIfUnknown(final Object object); void registerObject(final Object object, final UUID id);  }