class Example {
public static void main(String[] args) {
var licenses = List.of(
new License(1, true),
new License(2, false),
new License(3, true)
);
var licenseMap = licenses.stream()
.collect(Collectors.toMap(License::getId, License::isActive));
}
@Getter
@RequiredArgsConstructor
private static class License {
private final Integer id;
private final boolean isActive;
}
}