### Question:
RatingBuilder extends AbstractBeanEntityBuilder implements Builder<Rating> { @Override public Rating build() { Preconditions.checkState(hasUserId, "no user ID set"); Preconditions.checkState(hasItemId, "no item ID set"); Preconditions.checkState(hasRating, "no rating set"); if (!idSet) { if (!hasWarned) { logger.warn("creating rating without ID"); hasWarned = true; } id = idGenerator.incrementAndGet(); } if (timestamp >= 0) { return new Rating.WithTimestamp(id, userId, itemId, rating, timestamp); } else { return new Rating(id, userId, itemId, rating); } } RatingBuilder();  RatingBuilder(EntityType type); static RatingBuilder copy(Rating r); @Override RatingBuilder reset(); long getId(); @EntityAttributeSetter("id") RatingBuilder setId(long id); long getUserId(); @EntityAttributeSetter("user") RatingBuilder setUserId(long uid); long getItemId(); @EntityAttributeSetter("item") RatingBuilder setItemId(long iid); @EntityAttributeClearer("item") RatingBuilder clearItemId(); @EntityAttributeClearer("user") RatingBuilder clearUserId(); double getRating(); @EntityAttributeSetter("rating") RatingBuilder setRating(double r); @EntityAttributeClearer("rating") RatingBuilder clearRating(); long getTimestamp(); @EntityAttributeSetter("timestamp") RatingBuilder setTimestamp(long ts); @EntityAttributeClearer("timestamp") RatingBuilder clearTimestamp(); @Override Rating build();  }### Answer:
@Test public void testInitialState() { RatingBuilder rb = new RatingBuilder(); try { rb.build(); fail("building a rating should fail"); } catch (IllegalStateException e) { } }