Soroush Neyestani

Software Engineer

Application Architect

Enterprise Application Developer

Technical Author & Educator

Java Core Toolkit

A Type-Safe Java Library Built Around Explicit Contracts, Immutable Values and Reproducible Releases

Version: v0.1.0 · Public release: December 2026 · License: MIT · Java toolchain: Eclipse Temurin 25.0.5.1+2 · Build: Gradle 9.9.3
Focus: Generics, ordered collection copies, immutable labels and categories, validation, versioned UTF-8 codec, CLI and independent library consumption
Validation: 48 JUnit tests per CI job on Ubuntu 24.04 and Windows Server 2025; Checkstyle, JavaDoc, API-signature checks and consumer integration

Public repository · Official v0.1.0 release · Published API contract

Technical scope. This article describes the published v0.1.0 capabilities and release verification evidence. Illustrative Java snippets demonstrate standard JDK concepts, not Java Core Toolkit method signatures; consult the tagged API documentation for actual calls. CI, supply-chain and reproducibility claims are limited to the reported checks, not production benchmarks.


1. Why a Small Java Library Is an Engineering Project

A utility library may contain fewer classes than a typical application, yet its design mistakes can spread to every consumer. An unclear null policy forces callers to guess; a mutable result breaks assumptions across modules; an incompatible method signature can cause compilation failures downstream. The challenge is to define behavior precisely enough that other programs can depend on it without understanding its implementation.

Java Core Toolkit approaches this problem with a deliberately compact set of building blocks: type-safe collection operations, validated immutable values, a constrained text codec and a small command-line interface. The work goes beyond implementing the methods. It also checks API signatures, builds documented Java artifacts, compiles a separate consumer application and verifies results across two operating systems.

This is an independently consumable Java library, not a web service, a Spring application or an enterprise deployment. The release makes no claim of production adoption, throughput improvement or independently measured operational reliability. Its primary engineering result is a reproducible library and an inspectable contract.

2. Scope and Feature Map

The published v0.1.0 scope is intentionally narrow. Rather than offering hundreds of general-purpose helpers, it concentrates on a small set of cohesive operations. The article intentionally avoids inventing exact class names and method signatures; the linked API documentation is authoritative for those details.

Capability Documented behavior Boundary to respect
Typed collections Generic operations and order-preserving copies A copy is shallow; contained objects are not cloned
Immutable values Validated labels and categories/batches Immutability applies to explicitly owned state and documented invariants
Validation Invalid inputs rejected with defined errors No silent acceptance or automatic repair is implied
UTF-8 codec Restricted, versioned jct1: representation Not encryption and not a cryptographic authenticity mechanism
CLI Executable examples with distinct exit codes Input length depends on OS and shell limits
Distribution Executable JAR, source JAR, JavaDoc JAR and metadata Runtime needs only java.base; build dependencies are separate

An important design criterion is cohesion. Collections operations should have consistent copying rules; value objects should validate on construction; the codec should reject values outside its format; and the CLI should translate failures into documented process status codes. Consumers can then reason about the library as a set of contracts rather than disconnected conveniences.

3. Architecture: Public API, Core Rules and Adapters

The architecture can be understood as three conceptual boundaries. First, the public Java API exposes typed operations and value objects. Second, domain-independent rules enforce validation, immutability and deterministic encoding. Third, adapters and distribution artifacts let applications interact with the toolkit as a packaged JAR or a command-line executable.

Java consumer application           Command-line user
            |                                |
            v                                v
    Typed public Java API              CLI adapter
            |                                |
            +----------+---------------------+
                       |
        Collection / Value / Validation rules
                       |
                Versioned UTF-8 codec
                       |
                 java.base runtime

This is a conceptual view of responsibilities, not a claim about the exact source-package structure or a class dependency graph. The design benefit is separation: reusable business-neutral behavior should not depend on terminal arguments, while CLI parsing should not silently change the rules enforced by value objects or the codec.

A separate consumer compilation is stronger evidence of this boundary than unit tests alone. It detects packaging mistakes, inaccessible classes and accidental source-tree assumptions. However, one consumer smoke test does not prove that the API is compatible with every Java toolchain or downstream build ecosystem.

4. Typed Collections: Ordering, Generics and Shallow Copies

Java generics express the intended element type at compile time. Collection helpers should preserve that information rather than expose raw types or conceal unchecked casts. The published project specifically reports order-preserving copying. The essential question is what exactly is copied: the container’s structure, the contained values, or both.

The reported copy is shallow. A new collection structure can preserve element references and their encounter order without cloning the referenced objects. This may be entirely appropriate for immutable elements such as String or well-designed value objects, but it does not freeze mutable elements.

// Illustrative JDK-only example; not a Toolkit API signature.
var source = new java.util.ArrayList<String>();
source.add("alpha");
source.add("beta");
var snapshot = java.util.List.copyOf(source);
source.add("gamma");
// snapshot still contains alpha and beta in their original order.

The standard JDK example above illustrates a structure-level snapshot. It does not establish that the toolkit calls List.copyOf, accepts the same null policy, or returns the same implementation class. The exact toolkit contract must be checked in the tagged API documentation.

Copy contracts should specify source ordering, duplicate retention, null acceptance, exception behavior, ownership and mutation. For mutable element objects, callers still need independent safeguards. The practical trade-off is between efficient structural copying and the cost and complexity of deep copying, which would require a domain-specific element-copy policy.

5. Immutable Labels and Categories: Construction as a Trust Boundary

Value objects give a small piece of information a precise identity and set of invariants. The release includes validated immutable labels and category/batch-like values. Their value is not the number of fields they wrap but the reduction in invalid states that can be represented after construction.

A robust value object defines when its value is valid, how equality works, how hashing relates to equality, whether its representation is stable, and whether any exposed collection can be mutated indirectly. Java records are one possible language mechanism for this style of design, but the project report does not establish that every object is a record; the article does not assume so.

Immutability is a contract, not a keyword. A final reference can still point to a mutable collection. Therefore, a type that stores a collection needs defensive copying or another explicitly documented ownership model. For labels, input normalization is similarly an API choice: trimming, case folding, Unicode normalization and accepting empty strings can all affect equality and serialization. Those behaviors must be read from the published API, not guessed from the word “label.”

The trade-off is intentional constraint. Strict constructors may reject values that a permissive string wrapper would allow, but that rejection keeps invalid data from propagating into later operations.

6. Input Validation and Predictable Failure Semantics

Validation is most useful where untrusted or ambiguous input crosses into a more strongly constrained domain. The toolkit reports defined error codes and rejection of invalid input. This changes failure from an undocumented side effect into part of the public interface.

Validation rules should clarify nullability, minimum and maximum lengths, allowed characters, collection bounds, duplicate handling, and encoding assumptions wherever these are applicable to a particular API operation. The exact code or exception type is important to consumers: changing it can break error handling even when the successful output is unchanged.

One should also distinguish failure categories. Invalid business data is not the same as a malformed CLI invocation; a corrupted encoded string is not the same as an unexpected I/O failure. The project makes this distinction visible at its CLI boundary through three exit codes, discussed in Section 9.

A well-tested validation boundary exercises values directly adjacent to a limit, not just obviously valid and invalid samples. Unicode is relevant because Java string length, UTF-8 byte length and user-perceived character count are different concepts. For inputs constrained to ASCII, rejecting non-ASCII is a deliberate format rule, not evidence that arbitrary international text has been supported.

7. The jct1: Codec: Explicit Format and Limits

The project includes a constrained, versioned UTF-8 text representation identified by the prefix jct1:. A version marker provides an explicit way for a decoder to distinguish supported representations from incompatible ones. It does not by itself make a format extensible without further design work: old decoders must still know how to reject future versions safely.

The accepted API report documents an applicable maximum of 109,572 ASCII characters for the versioned representation/input contract. This is a scoped bound, not a promise that every arbitrary Unicode string of that length will be accepted. UTF-8 byte size and ASCII character count are only numerically identical when each character belongs to ASCII.

Illustrative envelope (not a complete grammar):

jct1:<version-specific, constrained payload>

Validate prefix -> Validate length/characters -> Decode -> Validate values

The envelope above explains the idea of a versioned codec. It is not a byte-level grammar and should not be used to implement an independent decoder. Consult the source specification before relying on escaping, delimiters, checksums, ordering, or canonicalization.

The important engineering distinction is serialization versus security. A text codec can protect structural invariants through parsing and validation. It cannot provide secrecy, cryptographic authenticity or tamper resistance merely because its output is encoded or versioned. An application handling attacker-controlled data must still establish its own trust boundary and, where required, apply authenticated encryption or signatures separately.

8. Failure Model and Security Boundaries

A small library still needs a threat model. The exposed entry points are Java method arguments, encoded data and shell arguments. Invalid text, oversized inputs, impossible category definitions, unsupported versions and maliciously constructed payloads should produce controlled, documented failures rather than undefined behavior.

Three boundaries matter particularly here. First, the library cannot guarantee deep immutability of caller-owned mutable elements when it performs shallow collection copies. Second, its codec does not authenticate data; the receiver must not treat a successfully decoded jct1: value as proof of the sender's identity. Third, the CLI is subject to argument limits and quoting rules imposed by the platform and execution environment.

The project’s public security evidence consists of reported Gitleaks and OSV scans in specific scopes. These checks are valuable release hygiene, but their zero-finding outcomes do not establish that the API is secure against all misuse or all vulnerabilities. The release also does not claim cryptographic review, fuzzing coverage beyond any reported tests, or production incident experience.

Clear limits help downstream developers choose suitable usage. This toolkit is useful for validated local transformations and CLI demonstrations; it should not be described as a security boundary or general-purpose encrypted object transport.

9. Command-Line Interface and Process-Level Contracts

The executable CLI provides a second way to exercise library functionality without embedding it in another application. It has a documented contract for process exit status:

Exit code Meaning Integration implication
0 Success The requested supported operation completed
2 Usage error Invocation or argument structure should be corrected
3 Invalid data Input violates a supported data or format rule

These distinctions are meaningful for scripts and automation because they let a caller decide whether to correct command syntax or fix the provided data. Tests checked the exit-code behavior using an executable JAR, rather than calling only Java methods within the same test JVM.

Practical CLI behavior also depends on the shell. Quoting rules differ, operating systems impose command-line size limits, and Java argument files can change how long argument lists are supplied. The release report records a long-input scenario tested with a Java argument file. That does not imply the CLI accepts unlimited input or that every shell and terminal has been tested.

Exact command names, subcommands and flags must come from the tagged README or CLI help. The presence of a jct1: format and exit codes does not authorize inventing commands such as --encode or --decode as actual supported switches.

10. Independent Consumption: Testing the JAR, Not the Source Tree

A library is only meaningfully reusable if another project can use its compiled distribution. The release reports that a separate Java consumer was compiled and executed against the packaged JAR. This verifies more than a unit test running inside the library repository: dependencies, class visibility and packaged entry points must be present in the artifact the consumer receives.

The executable JAR was reported to require only the standard Java module java.base at runtime. That is a narrower and more useful statement than claiming the build has no dependencies: Gradle, JUnit, Checkstyle and JavaDoc-related tooling are development-time components. The project also publishes source and documentation JARs and a POM to support inspection and integration.

A consumer still needs to match the library’s supported Java runtime level. The release was built and verified using Eclipse Temurin 25.0.5.1+2. The tested toolchain is evidence of compatibility with that environment, not evidence of compatibility with earlier unsupported JVM versions.

For exact package coordinates and API calls, readers should use the released POM and public API contract. This article intentionally avoids unverified Java import statements or method names.

11. Build Discipline: Gradle, Locked Dependencies and Static Checks

The accepted release uses Gradle 9.9.3 with locked dependencies. An early CI run failed in Gradle-version detection; explicitly selecting the pinned installation resolved that problem. This illustrates a core reproducibility lesson: identical source code is insufficient if the build executor selects different toolchain versions.

The reported verification toolchain was Temurin 25.0.5.1+2, JUnit 6.1.3 and Checkstyle 14.5.0. Gradle coordinates compilation, packaging, testing and documentation. Locked dependencies reduce one source of drift by constraining what the build resolves, although they do not prove that every external repository or operating system will remain available indefinitely.

Checkstyle validates configured style and structure rules. JavaDoc generation checks documentation production and relevant warnings. API-signature checks provide evidence that the exported surface matches the approved definition. None of these substitutes for functional tests: all three are complementary quality gates.

The project deliberately avoids runtime framework dependencies. A small dependency surface can simplify distribution and auditing, but a zero-external-runtime-dependency claim should be limited to the actual published executable JAR and its inspected runtime metadata.

12. Test Matrix: What the 48 JUnit Tests Establish

Two public GitHub Actions workflows were reported successful: one for main, another for the v0.1.0 tag. Each workflow ran on Ubuntu 24.04 and Windows Server 2025, giving four successful platform jobs. Each job executed the same 48 JUnit tests. This is repeated cross-platform execution, not 192 distinct test cases.

Public workflow Ubuntu 24.04 Windows Server 2025 Per-job verification
main CI Passed, reported Passed, reported 48 JUnit tests plus configured gates
v0.1.0 tag CI Passed, reported Passed, reported 48 JUnit tests plus configured gates

Other reported checks include Checkstyle, JavaDoc, API-signature verification, CLI process execution and separate consumer compilation and execution. The publicly documented security scans are discussed in Section 14.

These results support confidence in the exercised behaviors and build pipeline under the reported conditions. They do not measure throughput, prove memory safety for arbitrary inputs, guarantee all boundary cases are covered, or substitute for independent review. The evidence is strongest when understood as repeatability of a fixed suite across two platforms and two source references.

13. Reproducible Artifacts and Source Integrity

A release includes source code, compiled artifacts and metadata; these must be related by evidence rather than by a filename alone. The reported public main and v0.1.0 tag both point to commit 624aff020f57c3134df73e3368a01c03ecbb0de7. Ten release attachments were reportedly downloaded without authentication and verified by size and SHA-256. GitHub-generated ZIP and tarball contents matched the 46-file tagged source tree.

The official public source ZIP contains 46 files, and the release report records consistency with the tagged public source tree. The published executable JAR and source JAR were reported byte-identical across all four public CI jobs. POM and JavaDoc contents matched across Windows and Ubuntu after CRLF-to-LF normalization, which is not the same claim as raw byte identity.

Release artifact Reported SHA-256
Public source ZIP d747fddd63269d1183bb0db77212112298f4e22cd92d722cff34ca946e9fcf82
Executable JAR 07f8b90a01fb82010ef417c9beb5dc73b1b5097b6dc52fef42a58cbed9c307e3
Source JAR 6d401de2b1228723b50d6d1134e59255a200a530cacbeac641a54b9ef04f7da0
JavaDoc JAR 0475c6f6b16cd60dcfc596731a94f3303f07ad67ca865b52d14aebc63a2eeee9
POM 20a48e44ebc7f3800e5f078ce1761ff53091d352472caff99df25502d7804368

Official SHA256SUMS · Public verification report · Machine-readable evidence

14. Supply-Chain Hygiene, License and Publication Governance

The source is published under the MIT license, accompanied by applicable third-party notices. The publication report records zero Gitleaks findings in two public scans and no OSV findings for 28 locked Maven coordinates and two JavaScript dependencies associated with JavaDoc. Those are bounded scan results at the time and configuration of the release, not a guarantee of future or comprehensive absence of vulnerabilities.

The public repository reports protection of main through pull requests, resolved review conversations and three required successful CI checks. The version tag is protected against movement or deletion, force pushes and deletion of main are restricted, and GitHub reported the v0.1.0 release as immutable. These controls matter because a checksum has limited long-term value if the referenced artifact can later be silently replaced.

The public repository and official release provide the distribution and verification references readers need. Keeping the published source and evidence focused on the library makes it easier to audit artifacts and understand their provenance.

A released MIT library is still subject to ordinary integration due diligence: consumers should inspect the actual artifact, applicable notices, supported Java version and the security assumptions of the surrounding application.

15. Trade-offs, Limitations and Versioning

The design choices favor a small, understandable API over exhaustive functionality. A shallow collection copy is efficient and predictable but does not recursively duplicate state. Validation rejects unsupported inputs instead of attempting broad automatic coercion. A constrained codec supports a documented representation but avoids pretending to be a general-purpose serializer or cryptographic envelope. A CLI makes behavior observable, but remains limited by shell and OS semantics.

Semantic Versioning gives a vocabulary for compatibility, but v0.1.0 should not be confused with a promise of permanent API stability. Changes to exported types, accepted values, exception behavior, serialized representations or exit codes may affect consumers even if internal code changes are small. A future release should evaluate these effects explicitly.

Potential future directions—not commitments of the v0.1.0 release—include broader consumer compatibility checks, property-based input generation, mutation testing, fuzzing of codec boundaries, or more extensive runtime profiling. Each would require separate evidence before appearing as a completed capability.

The article does not substitute invented method signatures for the published contract: the public API document remains the authoritative source for method-level usage, null handling, parameter limits and supported commands.

16. How to Examine the Release and What It Demonstrates

A prospective consumer can follow a verifiable path: read the public API contract, inspect the source repository, download artifacts from the official release, compare local hashes with SHA256SUMS, and consult the verification report. The repository also includes a Persian learning guide for readers who prefer that language.

What Java Core Toolkit demonstrates is a disciplined library engineering workflow: define narrow behavior, expose it through types, validate invariants, package it for actual consumers, exercise it on multiple systems and preserve verifiable release artifacts. Its contribution is not a novel algorithm or an unmeasured speed advantage. It is the combination of bounded functionality, explicit limitations and repeatable engineering evidence.

Public source: Java Core Toolkit · Release: v0.1.0 · API: docs/API.md