/** * Builds a new {@link ImmutableTrain ImmutableTrain}. * @return An immutable instance of Train * @throws java.lang.IllegalStateException if any required attributes are missing */ public ImmutableTrain build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return new ImmutableTrain(name, carriages, observationCar); }