import java.time.DayOfWeek;
import java.time.LocalDate;
class Teste {
public static boolean fimDeSemana(LocalDate ld) {
DayOfWeek d = ld.getDayOfWeek();
return d == DayOfWeek.SATURDAY || d == DayOfWeek.SUNDAY;
}
public static void main
(String[] args
) { System.
out.
println(fimDeSemana
(LocalDate.
of(2017,
12,
19))); // false, terça-feira System.
out.
println(fimDeSemana
(LocalDate.
of(2017,
12,
20))); // false, quarta-feira System.
out.
println(fimDeSemana
(LocalDate.
of(2017,
12,
21))); // false, quinta-feira System.
out.
println(fimDeSemana
(LocalDate.
of(2017,
12,
22))); // false, sexta-feira System.
out.
println(fimDeSemana
(LocalDate.
of(2017,
12,
23))); // true, sábado System.
out.
println(fimDeSemana
(LocalDate.
of(2017,
12,
24))); // true, domingo System.
out.
println(fimDeSemana
(LocalDate.
of(2017,
12,
25))); // false, segunda-feira System.
out.
println(fimDeSemana
(LocalDate.
of(2017,
12,
26))); // false, terça-feira System.
out.
println(fimDeSemana
(LocalDate.
of(2017,
12,
27))); // false, quarta-feira System.
out.
println(fimDeSemana
(LocalDate.
of(2017,
12,
28))); // false, quinta-feira System.
out.
println(fimDeSemana
(LocalDate.
of(2017,
12,
29))); // false, sexta-feira System.
out.
println(fimDeSemana
(LocalDate.
of(2017,
12,
30))); // true, sábado System.
out.
println(fimDeSemana
(LocalDate.
of(2017,
12,
31))); // true, domingo System.
out.
println(fimDeSemana
(LocalDate.
of(2018,
1,
1))); // false, segunda-feira }
}
aW1wb3J0IGphdmEudGltZS5EYXlPZldlZWs7CmltcG9ydCBqYXZhLnRpbWUuTG9jYWxEYXRlOwoKY2xhc3MgVGVzdGUgewoKICAgIHB1YmxpYyBzdGF0aWMgYm9vbGVhbiBmaW1EZVNlbWFuYShMb2NhbERhdGUgbGQpIHsKICAgICAgICBEYXlPZldlZWsgZCA9IGxkLmdldERheU9mV2VlaygpOwogICAgICAgIHJldHVybiBkID09IERheU9mV2Vlay5TQVRVUkRBWSB8fCBkID09IERheU9mV2Vlay5TVU5EQV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