unit-test-utility-methods
This skill generates test patterns for utility classes with static methods and pure functions. It covers null handling, edge cases, boundary conditions, and common utilities like string manipulation, math helpers, validators, and collection operations using AssertJ assertions and parameterized tests.
unit-test-utility-methods generates test patterns for static utility functions, covering null handling, edge cases, and boundary conditions with AssertJ assertions.
AI-generated summary based on this skill's SKILL.md
Decision gist · record as of 2026-06-22
unit-test-utility-methods generates test patterns for static utility functions, covering null handling, edge cases, and boundary conditions with AssertJ assertions. This skill generates test patterns for utility classes with static methods and pure functions. It covers null handling, edge cases, boundary conditions, and common utilities like string manipulation, math helpers, validators, and collection operations using AssertJ assertions and parameterized tests.
Use it when
- unit-test-utility-methods emphasizes testing null handling in utilities through dedicated test cases.
- unit-test-utility-methods recommends AssertJ for fluent, chainable assertions that read like natural language.
Verify before relying
Read SKILL.md below before installing (3 files). Open directory: indexed for reading, not audited.
Install
giuseppe-trisciuoglio/developer-kit/unit-test-utility-methods · repository language: Python
Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.
Frequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How do I test utility classes with static methods?
unit-test-utility-methods focuses on testing static utility methods by isolating each method and verifying its behavior independently. Create a test class for each utility, use @Test for individual cases, and @ParameterizedTest for multiple input scenarios. Test pure functions by providing known inputs and asserting expected outputs without side effects. Use AssertJ for readable assertions like assertThat(result).isEqualTo(expected).
What patterns does unit-test-utility-methods use for null handling?
unit-test-utility-methods emphasizes testing null handling in utilities through dedicated test cases. Include tests that pass null arguments and verify the utility either returns null, throws a NullPointerException, or handles it gracefully per design. Use @ParameterizedTest with null values in your test data set. Document expected behavior explicitly—whether nulls are rejected, tolerated, or converted to defaults.
How can I write readable assertions using AssertJ?
unit-test-utility-methods recommends AssertJ for fluent, chainable assertions that read like natural language. Replace assertEquals with assertThat(actual).isEqualTo(expected). For collections, use assertThat(list).contains(item).hasSize(3). For strings, use assertThat(str).startsWith(prefix).endsWith(suffix). These assertions produce clearer failure messages and make test intent obvious at a glance.
What edge cases should unit-test-utility-methods cover?
unit-test-utility-methods covers boundary conditions like empty strings, zero values, negative numbers, empty collections, and maximum/minimum integer bounds. Test string utilities with whitespace-only input, special characters, and unicode. For math helpers, test division by zero, overflow scenarios, and precision limits. Use @ParameterizedTest to systematically run the same assertions across multiple edge case inputs.
How do I test pure functions with unit-test-utility-methods?
unit-test-utility-methods treats pure functions as deterministic: same input always produces same output with no side effects. Test by calling the function multiple times with identical arguments and asserting identical results. Avoid mocking or state changes. Use @ParameterizedTest to validate behavior across a range of valid, invalid, and boundary inputs. This approach ensures utility methods remain predictable and reusable.
Can unit-test-utility-methods validate string and collection utilities?
unit-test-utility-methods validates string utilities like trim, split, replace, and case conversion by testing normal cases, empty strings, null input, and special characters. For collection utilities, test filtering, mapping, sorting, and merging with empty collections, single items, and duplicates. Use AssertJ's collection assertions: assertThat(result).containsExactly(expected) or assertThat(result).isEmpty().
SKILL.md
Rendered from the published skill. Quoted content, verbatim.
Unit Testing Utility Classes and Static Methods
Overview
This skill generates tests for utility classes with static helper methods and pure functions. It provides patterns for testing null handling, edge cases, boundary conditions, and common utilities like string manipulation, calculations, data validation, and collections. Pure functions require no mocking.
When to Use
Use this skill when: - Writing tests for utility/helper classes with static methods - Testing pure functions with no state or side effects - Testing string manipulation, formatting, or transformation utilities - Testing calculation, conversion, or math helper functions - Testing data validation and formatter utilities -
(truncated - see the full file via the links below)
File tree — 3 files
plugins/developer-kit-java/skills/unit-test-utility-methods/SKILL.md
plugins/developer-kit-java/skills/unit-test-utility-methods/references/edge-cases.md
plugins/developer-kit-java/skills/unit-test-utility-methods/references/parameterized-tests.md
Let your AI agent find skills like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.
wish › “Generate unit tests for utility classes and static helper methods”
Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →
Related skills
This skill provides systematic testing patterns for Java boundary conditions and corner cases using JUnit 5 and AssertJ. It covers numeric limits, string edge states, collection boundaries, floating-point precision, date/time edges, and array indexing scenarios. Use parameterized tests and tolerance-based assertions to validate that your code handles limits, special inputs, and overflow/underflow correctly.
Automatically generate well-structured JUnit 5 test cases for Java classes, complete with Mockito mocking, parameterized test scenarios, and edge case handling. The skill follows Arrange-Act-Assert patterns, creates tests for exception handling, verifies mock interactions, and targets high test coverage across service layers and Spring Boot components.
Test Quality guides you through writing maintainable Java tests using JUnit 5 and AssertJ. It covers the Arrange-Act-Assert pattern, collection and exception assertions, nested test organization, and parameterized testing to improve code coverage and test readability.
Build reliable unit tests for Java applications using JUnit 5, Mockito, and AssertJ with support for mocking, parameterized tests, and fluent assertions. Includes integration testing patterns with Testcontainers and Spring Boot Test, plus TDD and test coverage best practices to improve code quality.
Master isolated service layer testing using Mockito to mock repositories and external clients without database or API calls. This skill teaches you to arrange test data, verify method interactions, and handle exception scenarios with AssertJ assertions.
Learn to unit test Spring REST controllers using MockMvc with mocked service dependencies. This skill covers testing HTTP methods, validating responses with JsonPath, handling errors, checking headers, and verifying content negotiation—all with focused examples for GET, POST, PUT, and DELETE endpoints.