OptionalTsData { @NonNull public static Builder2<LocalDate> builderByLocalDate(@NonNull ObsGathering gathering, @NonNull ObsCharacteristics... characteristics) { return builder(gathering, toEnumSet(characteristics), OptionalTsData::getYearMonthDay, OptionalTsData::getIdFromYearMonthDay); }  @NonNull static OptionalTsData present(@NonNull TsData data); @Deprecated @NonNull static OptionalTsData present(@NonNegative int nbrRows, @NonNegative int nbrUselessRows, @NonNull TsData data); @NonNull static OptionalTsData absent(@NonNull String cause); @Deprecated @NonNull static OptionalTsData absent(@NonNegative int nbrRows, @NonNegative int nbrUselessRows, @NonNull String cause); @NonNull static Builder2<Date> builderByDate(@NonNull Calendar resource, @NonNull ObsGathering gathering, @NonNull ObsCharacteristics... characteristics); @NonNull static Builder2<LocalDate> builderByLocalDate(@NonNull ObsGathering gathering, @NonNull ObsCharacteristics... characteristics); @Deprecated @NonNegative int getNbrRows(); @Deprecated @NonNegative int getNbrUselessRows(); abstract boolean isPresent(); @NonNull @NewObject abstract TsData get(); @NonNull TsData or(@NonNull TsData defaultValue); @Nullable abstract TsData orNull(); @NonNull abstract String getCause();  }
@Test public void testBuilderByLocalDate() { CustomFactory<LocalDate> factory = new CustomFactory<LocalDate>() { @Override public Builder2<LocalDate> builderOf(ObsGathering gathering) { return builderByLocalDate(gathering); } @Override public LocalDate dateOf(int year, int month, int dayOfMonth) { return LocalDate.of(year, month, dayOfMonth); } }; testBuilderAdd(factory); testBuilderPresent(factory); testBuilderAbsent(factory); }