EntityTagBuilder { static Optional<EntityTag> buildFromEntity(@Nullable final Object entity) { if (entity == null) { return Optional.empty(); } if (entity instanceof Entity) { return buildForTopLevelEntity((Entity<? extends Revision>) entity); } else { return buildForSubEntity(entity); } } private  EntityTagBuilder();   }
@Test public void buildForNull() { final Optional<EntityTag> builtETagValue = EntityTagBuilder.buildFromEntity(null); assertThat(builtETagValue).isNotPresent(); }