Kenneth Kousen

President, Kousen IT, Inc.

Ken Kousen is a Java Champion, several time JavaOne Rock Star, and a Grails Rock Star. He is the author of the Pragmatic Library books “Mockito Made Clear” and “Help Your Boss Help You,” the O'Reilly books “Kotlin Cookbook”, “Modern Java Recipes”, and “Gradle Recipes for Android”, and the Manning book “Making Java Groovy”. He also has recorded over a dozen video courses for the O'Reilly Learning Platform, covering topics related to Android, Spring, Java, Groovy, Grails, and Gradle.

His academic background include BS degrees in Mechanical Engineering and Mathematics from M.I.T., an MA and Ph.D. in Aerospace Engineering from Princeton, and an MS in Computer Science from R.P.I. He is currently President of Kousen IT, Inc., based in Connecticut.

Presentations

In this session, we'll rank the features added to Java between versions 1.8 and 24 (or whatever version is current at the time). Those include the basic functional features, like streams, lambdas, and method references, through code improvements like switch expressions, records, and pattern matching. We'll include simple topics like LVTI and collection factory methods, as well more recent additions like sealed interfaces and virtual threads. Vote for your favorite (and/or least favorite) feature!

Examples will demonstrate dataoriented programming concepts, combining sealed interfaces, records, pattern matching for switch, and more. Other examples will access RESTful web services, integrate with AI tool, and refactor existing Java 8 code to take advantage of new features.

As far as Java is concerned, most AI tools are just another RESTful web service. In this session, learn how to use modern Java features like records, text blocks, the HTTP Client API and more to access ChatGPT, the Whisper audio-to-text transcription API, and image generators like DALL-E, Stable Diffusion, and Midjourney.

Records naturally map to JSON structures, and there are a wide variety of networking libraries available. Text blocks make it easy to create multi-inputs for services. Ultimately data-driven approaches, which combine sealed interfaces and records, make it easy to build powerful clients for AI web services.

Discover how Claude Code, Anthropic’s new agentic coding assistant, is redefining developer productivity directly from the terminal. In this session, we’ll explore how Claude Code leverages advanced natural language understanding to help you refactor, document, and debug code using conversational prompts. See live demonstrations of how Claude Code can streamline complex workflows—handling multi-step tasks, automating documentation, accelerating debugging, and even running tests or linting—all in a single pass.

We’ll dive into the tool’s unique capabilities, including its reasoning and language comprehension, multimodal integration, and built-in Git support for seamless version control. You’ll walk away with a clear understanding of how to incorporate Claude Code into your daily development process, improving code quality, maintainability, and collaboration, while saving valuable time. Whether you’re new to AI-assisted coding or looking to expand your toolkit, this session will equip you with practical techniques to harness Claude Code’s full potential and transform your coding workflow.

As far as Java is concerned, most AI tools are just another RESTful web service. In this session, learn how to use modern Java features like records, text blocks, the HTTP Client API and more to access ChatGPT, the Whisper audio-to-text transcription API, and image generators like DALL-E, Stable Diffusion, and Midjourney.

Records naturally map to JSON structures, and there are a wide variety of networking libraries available. Text blocks make it easy to create multi-inputs for services. Ultimately data-driven approaches, which combine sealed interfaces and records, make it easy to build powerful clients for AI web services.

This session highlights the best features of the JUnit and AssertJ testing libraries. That will include running tests in parallel, parameterized tests from a variety of sources, custom extensions for callbacks, and much more.

This talk will cover topics like the set of useful functional interfaces available, how to do parameterized tests with various sources, lazy loading of error messages, and more.

In the rapidly evolving landscape of artificial intelligence, the ability to create custom Generative Pre-trained Transformers (GPTs) is not just a technological breakthrough but a gateway to new opportunities and unforeseen challenges. This talk delves into the simplicity and intricacies of crafting bespoke GPT models using OpenAI's playground. We'll explore how easily one can load personal data into these models, transforming generic AI into a tool tailored to specific needs and interests. However, this ease comes with a caveat – currently, these custom models are accessible exclusively to premium OpenAI account holders, pending the launch of a wider distribution platform.

The presentation will further illuminate the dual nature of custom GPTs: While they are augmented with user-provided data and instructions, their responses are still deeply rooted in their original, extensive training datasets. This inherent characteristic can lead to outputs that might not align with the creator's intentions or expectations, presenting a unique set of challenges.

Additionally, the talk will contrast the relative simplicity of using the playground for custom GPTs with the more complex, yet potent AI Assistants API. This API offers a more intricate approach, requiring coding expertise but providing the flexibility to integrate AI capabilities directly into applications. It shifts the paradigm from an external tool to an integral component of user-developed software.

A core belief of our current culture is that hard work leads to success. While there is some truth to that, it's far too tempting to go to extremes and lose yourself in the process. This isn't an accident. Companies have been trying to instill the “time is money” priority in workers for decades. Over time, however, the so-called “cult of efficiency” resulted in the feeling that we live to work, rather than work to live.

Based on the best-selling book of the same name by Celeste Headlee, this talk looks at how companies manipulated us into feeling obligated to spend far too much time at work, and far too much time staying connected to work even when we're not there. The goal is to find ways to take back your life and establish a realistic balance between what you do for a living, and who you are as a person.

The presentation covers how we got into the present situation, and practical steps we can take to reclaim your time, your values, and your life.

Conflict between technical professionals and traditional managers is inevitable, because you want different things. Worse, most employees feel that when conflicts arise, their only options are either to go along with what the manager wants, or leave. Neither option gets you what you want when you want it.

This talk discusses a third option: how to build a relationship over time that makes your boss an ally. The goal is to build a productive relationship that allows you to push back against decisions you don't like, while maintaining a constructive, loyalty-based relationship that satisfies both sides. Topics will include the two messages to keep in mind whenever you interact with the boss, how to use solutions to the iterated Prisoner's Dilemma problem to resolve conflicts, how to structure communications in way most likely to be heard and understood, and more.

The fundamental testing libraries in Java have undergone complete redesigns in the past few years. JUnit 5 redesigns the most well-known tool in all of testing. The most popular mocking library, Mockito, has also been rebuilt. This workshop will introduce the new features, help you use them as intended, and discuss experimental ideas still in the pipeline.

JUnit has been remarkably stable over the years and is one of the most widely adopted frameworks in the Java world. The latest version, JUnit 5, takes JUnit to the next level. Full of new features like conditional test execution, parametric testing, labeling and filtering tests, and more, it brings all the modern thinking on testing into the JUnit world. It also takes advantage of the functional features added to Java since version 8 to create a powerful, new library for testing your code. With the release of Mockito 3, the mocking library now requires functional features from Java 8 and takes advantage of them in interesting ways. This workshop helps you work with both libraries.

Gradle has been described as the open source project with the most documentation that doesn't help. Key concepts, like the different steps Gradle takes at initialization time, configuration time, and execution time are not obvious, but must be understood to use Gradle effectively. This talk will cover those topics, as well as how to use source sets, IDE integration, testing in parallel, the build cache, and multi-project builds.

New topics to be included based include writing your own custom tasks, using version constraints, archiving and expanding files and folders, and incremental builds for efficiency.

Recently revised to include dependency conflict resolution, lazy task creation, the TOML file for versioning, and more.

Learn the basic syntax and semantics for the Kotlin programming language. Kotlin is an alternative JVM language that provides null safety, static typing, and powerful IDE support. This workshop will give you the chance to code in Kotlin, highlighting its similarities and differences from Java, how to use functional programming skills, work with collections, access restful web services, and more.

This workshop will examine features of Kotlin at a greater depth than most tutorials. Coroutines – the most popular feature of the language – will also be covered, as well as higher order functions, reduction operations like reduce and fold, and lambdas with receivers. Those topics progress toward building DSLs and builders in Kotlin. Terms like “apply”, “let”, “use”, “also”, and “with” will be covered along with their typical use cases.

Details of the type system, including the Any, Unit, and Nothing classes, will be included. Examples will be provided on how to define extension functions, infix operators, and inlining functions for efficiency.

Add AI capabilities to your Java systems using the excellent LangChain4j framework. Add chat capabilities, image generation, vision models, texttospeech, transcription, and more, quickly and easily. RetrievalAugmented Generation (RAG) will also be included, using a variety of sources, including pdf, HTML, Word docs, and URL resources. The workshop will also demonstrate how to access models added to your local machine using the Ollama system.

The workshop will use Java 17 or above. Those who wish to code along will need to register and get an API key from OpenAI. Other models discussed will be Mistral, Anthropic (Claude), and Google (Gemini), as well as open source models running on your local machine using Ollama.

This workshop discusses the features added to Java since Java 8. After a review of the functional additions (streams, lambda expressions, and method references), topics will include Local Variable Type Inference (LVTI), collection factory methods, the Java shell, the new HTTP client, the enhanced switch statement, text blocks, records, pattern matching, and sealed classes.

Features will be demonstrated for Java versions from 8 through 17, using preview versions where available.

  • Java Licensing and Release Schedule
  • Functional Programming in Java
    • Lambda expressions
    • Method references
    • Streams
    • Optional data type
    • Static and default methods in interfaces
  • The java.time Package
  • Collection Factory Methods
    • List.of
    • Set.of
    • Map.of
    • Map.ofEntries
  • Local Variable Type Inference
  • JShell
  • HTTP Client
  • Enhanced Switch Statement
  • Text Blocks
  • Records
  • Pattern Matching
  • Sealed Classes
  • Miscellaneous Features
  • A bit about JPMS

Java is now on a six-month release schedule, with new features being added all the time. This talk summarizes the features that have been added to Java, including collection factory methods, private methods in interfaces, records, the enhanced switch statement, and more. The goal is to show not only what has been added, but why and where to use them.

Additional topics will include Local Variable Type Inference, the new HTTP client, the pattern matching, and text blocks. This talk will be updated throughout the year as more features are added to new releases.

The threat to your job isn’t that an AI can replace you — it’s that a manager will think AI can replace you. This talk covers how to build a relationship with your manager that makes you their primary technical ally.

The idea is to become the person they trust to evaluate both the benefits — and the costs — of using AI tools, showing where they can help and where you really need to be careful using them. In a rapidly changing world, you can become the person your manager relies on to give them good advice, all while you get to enjoy playing with the latest toys.

Mental Bookmarks and the Fractal Nature of Success - Video Preview

Good discussions are supposed to diverge from their intended path. Free association is a feature, not a bug, and helps you see new connections between ideas. Without structure, however, it can be difficult to add context to new ideas and understand how they relate to more immediate problems. This talk discusses the technique of mental bookmarks – how to remember where you were when a discussion diverged. In addition to giving you a reputation for having an amazing memory, the skill also helps with personal awareness in general.

To give the technique context, we'll look at the fractal nature of success – the way we tend to see our current environment in relative terms, always comparing ourselves to those slightly more successful and slightly less successful.

This session shows the features and optimal ways to generated mocks, stubs, and spies with Mockito. Find out when tools like Mockito are useful and how best to employ them to diagnose issues in your code.

Features covered will include creating mocks and stubs, mocking final methods and classes, mocking static methods, and spying on existing classes. It will also cover when NOT to use mocks and stubs, so you don't waste time testing the wrong things.

With much of the industry finally migrating to Java 11, 17, or 21, it’s time to learn about many of the newer features you can use in your code. None of the changes since Java 8 have been as dramatic as the move to functional programming, but collectively the latest capabilities can really streamline the way you work. This talk summarizes several of them, like records and record patterns, sealed classes and interfaces, switch expressions, the HTTP client API, pattern matching for switch, and more, using them together in an app to see how they interact and improve your Java coding experience.

This talk summarizes several of them, like records and record patterns, sealed classes and interfaces, switch expressions, the HTTP client API, pattern matching for switch, and more, using them together in an app to see how they interact and improve your Java coding experience.

This talk will be tailored to Java developers as we delve into the practical applications of AI tools to ease your software development tasks. We'll explore the capabilities of GitHub Copilot used as a plugin for IntelliJ IDEA and VSCode. We'll also play with GPT4 and examine ways it can help.

It's often said that AI tools will not replace existing developers, but that a developer with those tools will have an advantage over developers without them. Join us as we try to demystify the world of AI for Java developers, equipping you with practical skills to incorporate these tools into your development workflow. Note that this is a rapidly changing field, and the talk will evolve to work with the latest features available.

As context windows on AI tools continue to grow, it becomes easier to add necessary information to the current request rather than go through the hassle of preprocessing your data and embedding it into a vector database. This talk will discuss both situations: when it is useful and appropriate to stuff the prompt, and when it is better to create embeddings and do a similarity search.

Examples will include a variety of data loaders and vector databases, as well as embedding algorithms.

Property-based testing (PBT) validates the expected behavior of a system by checking it against a range of data points. A well-chosen set of properties will give the user a lot of confidence that the system is behaving as expected. The idea is that when the code is modified, failures in the tests reveal problems that would not have been found otherwise. This talk will cover the basic principles and several examples of PBT, using the jqwik library.

PBT allows you to define invariants (like reversing a list twice should result in the original list) and verify that they hold given generated changes that include a wide range of random inputs, including edge and corner cases. The jqwik library works well with JUnit to provide an important part of your testing strategy.

The Spring AI project is in early alpha, but is under rapid development. This session will show you the capabilities being designed into the framework, like Prompt Templates, Output Processors, Loaders, Vector databases, Message Chains, and more.

The idea is to be able to add several OpenAI features to your existing Spring apps, like regular chat, but also embeddings, which allow AI tools to work with your existing data.

The Spring AI project is in its infancy and promises to be quite helpful when it’s ready for prime time. Regular core Spring, however, brings many useful tools to the table for interacting with any restful web service, and the AI tools are no exception.

In this talk, we’ll use HTTP Exchange Interfaces, the included Jackson JSON parser, Java records, text blocks, and more to build clients for several of OpenAI’s services, including ChatGPT, DALL-E, and Whisper. All these features can be added to your Spring applications right away, while you wait for the refinements coming in the Spring AI project.

Spring is an incredibly flexible framework that makes programming Java quicker, easier, and safer for everybody. Spring’s focus on speed, simplicity, and productivity has made it the world's most popular Java framework and a highly sought-after developer skill in the market.

Spring Boot transforms how you approach Java programming tasks, radically streamlining your experience. Spring Boot combines necessities such as an application context and an auto-configured, embedded web server to make microservice development a cinch.

In this live, instructor-led, full day deep dive, award-winner author and instructor Ken Kousen takes us on the journey from “hello world” to Real World

Key Takeaways

  • Create web apps and restful web services
  • Understand Spring's dependency injection and POJO-based model
  • Learn how to test all kinds of Spring applications
  • Work with Spring's persistence and transactional models for relational databases

Spring is still the leading open source framework in the Java world for building web apps and web services. This workshop will walk through creating both, with special emphasis on deployable restful web services. In addition to the basic code, the workshop will look at how Spring operates, including the proxy design pattern, interceptors, managing singletons, and more.

=== Spring MVC architecture

  • Major concepts
  • Processing HTTP requests and responses
  • Configuration options
  • Test support

=== Spring Boot Features

  • Spring MVC autoconfiguration
  • HTTP message converters
  • JSON serializers
  • Serving static content
  • Using template engines

=== Special bean types

  • Handler mappings
  • View resolvers
  • Filters and interceptors
  • Exception resolvers
  • Content negotiation and REST

=== Annotated controllers

  • Request mapping
  • Handler methods
  • Model objects
  • Data binding and validation

=== Functional endpoints

  • Handler functions
  • Router functions and beans
  • Deployment options
  • Alternative language features

Gradle introduced Kotlin DSL in 2016 and formally released it in 2019. Recently the Kotlin DSL has become the default language for all new Gradle builds. It's probably time to learn about it: what are its advantages and disadvantages, how you can move from the Groovy DSL to the Kotlin DSL, and whether it's worth your time and effort to learn and use.

The Kotlin DSL brings strong typing, null safety, and, most importantly, powerful IDE support. The goal is to improve the user experience with Gradle build files through code assist and improved readability. This presentation will demonstrate the new build style, both for Java projects and for Kotlin projects.

The talk will include recommendations on how to move from the Groovy DSL to Kotlin, how to navigate and use the Kotlin DSL samples in the documentation, how to define tasks, use plugins, and more.

This comprehensive presentation explores the evolution of Java from version 8 through 25, demonstrating how the language has transformed from an object-oriented platform into a modern, multi-paradigm programming language. Starting with Java 8's functional programming revolution—including lambdas, streams, and Optional—the presentation traces Java's journey through significant milestones like records, pattern matching, virtual threads, and data-oriented programming. Through practical code examples from a real repository, attendees will see how these features work together to create more expressive, maintainable, and performant applications.

The presentation begins with Java 8's game-changing features, using the ProcessDictionaryV2 example to showcase functional programming patterns, higher-order functions, and advanced Stream API usage including collectors like groupingBy and teeing. It then progresses through Java 9-11's quality-of-life improvements (var, HTTP Client, String enhancements), Java 12-17's language evolution (text blocks, records, pattern matching, sealed classes), and Java 18-21's modern capabilities (virtual threads for massive scalability, sequenced collections). Special attention is given to Data-Oriented Programming, demonstrating how records, sealed classes, and pattern matching combine to create a new programming paradigm. The presentation also covers cutting-edge features like unnamed variables (_) and looks ahead to Java 25 LTS with scoped values and performance improvements. Throughout, best practices are emphasized, including embracing immutability, leveraging pattern matching for cleaner code, using virtual threads for I/O-bound operations, and adopting modern APIs over legacy alternatives. All examples are drawn from the accompanying repository, providing attendees with working code they can explore and adapt for their own projects.

Over the past few years, the basic idioms and recommended programming styles for Java development have changed. Functional features are now favored, using streams, lambda expressions, and method references. The new sixmonth release schedule provides the language with new features, like modules and local variable type inference, much more frequently. Even the new license changes in the language seem to complicate installation, usage, and especially deployment.

The purpose of this training course is to help you adapt to the new ways of coding in Java. The latest functional approaches are included, including using parallel streams for concurrency, and when to expect them to be useful. All the new significant features added to the language will be reviewed and evaluated, with the goal understanding what problems they were designed to handle and when they can be used effectively in your code.

AI tools are used to create a short libretto for a classic opera given a frankly ridiculous situation. Two models generate the text in tandem. Another model acts as a reviewer to evaluate the result. Illustrations are generated using an image generator. Snippets of music are created from parts of the text using a music system. A podcast is then generated discussing the quality and historical ramifications of the opera, using yet another model. It's AI models all the way down, with appropriately tragic results.

The idea is to evaluate the limits of what multimodal AI tools can and can not do, both individually and together.

Books

  • The introduction of functional programming concepts in Java SE 8 was a drastic change for this venerable object-oriented language. Lambda expressions, method references, and streams fundamentally changed the idioms of the language, and many developers have been trying to catch up ever since. This cookbook will help. With more than 70 detailed recipes, author Ken Kousen shows you how to use the newest features of Java to solve a wide range of problems.

    For developers comfortable with previous Java versions, this guide covers nearly all of Java SE 8, and includes a chapter focused on changes coming in Java 9. Need to understand how functional idioms will change the way you write code? This cookbook—chock full of use cases—is for you.

    Recipes cover:

    • The basics of lambda expressions and method references
    • Interfaces in the java.util.function package
    • Stream operations for transforming and filtering data
    • Comparators and Collectors for sorting and converting streaming data
    • Combining lambdas, method references, and streams
    • Creating instances and extract values from Java’s Optional type
    • New I/O capabilities that support functional streams
    • The Date-Time API that replaces the legacy Date and Calendar classes
    • Mechanisms for experimenting with concurrency and parallelism
  • Using the Android Studio IDE and the Gradle build tool will make Android app development much simpler—as long as you know your way around Gradle. This practical guide shows you how Gradle works with Android so that you can use it effectively on your projects. You’ll learn ways to customize project layouts, add dependencies, and even generate multiple different versions of your application.

    • Use Gradle independently and from with the new preferred IDE, Android Studio
    • Integrate tests into standard Android project builds
    • Easily customize builds to add popular third-party libraries as dependencies
    • Generate artifacts with various properties, like debug or release, and different flavors, like paid or free

Making Java Groovy

by Ken Kousen

  • Summary

    Making Java Groovy is a practical handbook for developers who want to blend Groovy into their day-to-day work with Java. It starts by introducing the key differences between Java and Groovy—and how you can use them to your advantage. Then, it guides you step-by-step through realistic development challenges, from web applications to web services to desktop applications, and shows how Groovy makes them easier to put into production.

    About this Book

    You don't need the full force of Java when you're writing a build script, a simple system utility, or a lightweight web app—but that's where Groovy shines brightest. This elegant JVM-based dynamic language extends and simplifies Java so you can concentrate on the task at hand instead of managing minute details and unnecessary complexity.

    Making Java Groov is a practical guide for developers who want to benefit from Groovy in their work with Java. It starts by introducing the key differences between Java and Groovy and how to use them to your advantage. Then, you'll focus on the situations you face every day, like consuming and creating RESTful web services, working with databases, and using the Spring framework. You'll also explore the great Groovy tools for build processes, testing, and deployment and learn how to write Groovy-based domain-specific languages that simplify Java development.

    Written for developers familiar with Java. No Groovy experience required.

    Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.

    What's Inside

    • Easier Java
    • Closures, builders, and metaprogramming
    • Gradle for builds, Spock for testing
    • Groovy frameworks like Grails and Griffon

    About the Author

    Ken Kousen is an independent consultant and trainer specializing in Spring, Hibernate, Groovy, and Grails.

    Table of Contents

      PART 1: UP TO SPEED WITH GROOVY
    1. Why add Groovy to Java?
    2. Groovy by example
    3. Code-level integration
    4. Using Groovy features in Java
    5. PART 2: GROOVY TOOLS
    6. Build processes
    7. Testing Groovy and Java projects
    8. PART 3: GROOVY IN THE REAL WORLD
    9. The Spring framework
    10. Database access
    11. RESTful web services
    12. Building and testing web applications
  • Number of Videos: 4 hours - 23 lessons
    Author: Ken Kousen
    User Level: Beginner
    Learn the advantages of using Groovy by itself and with existing Java projects. This video workshop takes you into the heart of this JVM language and shows you how Groovy can help increase your productivity through dynamic language features similar to those of Python, Ruby, and Smalltalk. Presenter and Java consultant Ken Kousen demonstrates how writing anything from a simple build script to a full scale application is much easier with Groovy than with Java. You’ll quickly learn how to add Groovy to your projects, and then explore the language through a host of examples and demonstrations. Once you complete this course, check out Ken’s other videos on the subject: Practical Groovy and Mastering Groovy. - Walk through Groovy’s basic data types. Use the “slashy” string syntax to define regular expressions. - Learn how operator overloading in the libraries simplifies your code - Control and customize all the natural defaults and autogenerated code in POGOs - Get demonstrations on using closures, and mixing Java and Groovy classes together - Know when and how to use Abstract Syntax Tree (AST) transformations - Parse and generate both XML and JSON - Access RESTful web services with ease Ken Kousen, President of Kousen IT, Inc., is a technical trainer, mentor, and consultant in all areas related to Java, specializing in Android, Spring, Hibernate/JPA, Groovy, and Grails. He is the author of Making Java Groovy (Manning) and the upcoming O’Reilly book, Gradle for Android.

    System Requirements:
    • Supported OS:   [Mac Mountain Lion 10.8, Mac Lion 10.7, Mac Snow Leopard 10.6, Mac Leopard 10.5, Mac OS X, Macintosh]
    • Processor:   Any
    • RAM:   Any
    • Hard Disk:   3GB
    • Video Card:   Any