# neon010/java-demo architecture

> Architecture diagram of the GitHub repository neon010/java-demo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/neon010/java-demo
- Repository: https://github.com/neon010/java-demo

## Overview

This repository is a set of standalone Java examples, not one integrated application. Its main themes are concurrency and asynchronous work, alongside small collection and employee-stream exercises. The user workflow is to run an individual demo and observe computed results or concurrency behavior. The graph preserves the distinct examples; simulated API calls are not external services. Relationships are limited to calls visible in the excerpts, so no connections are inferred between independent demos.

Main entry points: [`ProducerConsumerBlockingQueue.java`](https://github.com/neon010/java-demo/blob/main/ProducerConsumerBlockingQueue.java) (Blocking Buffer), [`ProducerConsumerWaitNotify.java`](https://github.com/neon010/java-demo/blob/main/ProducerConsumerWaitNotify.java) (Wait Buffer), [`ExecutorFutureDemo.java`](https://github.com/neon010/java-demo/blob/main/ExecutorFutureDemo.java) (Executor Futures), [`Main.java`](https://github.com/neon010/java-demo/blob/main/Main.java) (Employee Queries)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_async["Async Work"]
  node_executor["Executor Futures"]
  node_future_tasks["Square Tasks"]
  node_future_stages["Future Stages"]
  node_api_agg["API Aggregation"]
  node_virtual_agg["Virtual Threads"]
end

subgraph group_coord["Thread Coordination"]
  node_bank["Account Safety"]
  node_blocking_producer["Queue Producer"]
  node_blocking_queue["Blocking Buffer"]
  node_blocking_consumer["Queue Consumer"]
  node_wait_producer["Wait Producer"]
  node_wait_buffer["Wait Buffer"]
  node_wait_consumer["Wait Consumer"]
end

subgraph group_collections["Collections"]
  node_lru[("Thread-Safe LRU")]
  node_frequency["Word Frequency"]
  node_dedupe["Duplicate Removal"]
end

subgraph group_employee["Employee Streams"]
  node_employee_model["Employee Model<br/>[Employee.java]"]
  node_employee_queries["Employee Queries<br/>[Main.java]"]
end

node_runner(("Demo Runner"))

node_executor -->|"submits"| node_future_tasks
node_blocking_producer -->|"puts items"| node_blocking_queue
node_blocking_consumer -->|"takes items"| node_blocking_queue
node_wait_producer -->|"puts items"| node_wait_buffer
node_wait_consumer -->|"takes items"| node_wait_buffer
node_employee_queries -->|"creates employees"| node_employee_model

click node_executor "https://github.com/neon010/java-demo/blob/main/ExecutorFutureDemo.java"
click node_future_tasks "https://github.com/neon010/java-demo/blob/main/ExecutorFutureDemo.java"
click node_future_stages "https://github.com/neon010/java-demo/blob/main/CompletableFutureDemo.java"
click node_api_agg "https://github.com/neon010/java-demo/blob/main/ApiAggregatorDemo.java"
click node_virtual_agg "https://github.com/neon010/java-demo/blob/main/VirtualThreadsAggregator.java"
click node_bank "https://github.com/neon010/java-demo/blob/main/BankAccountDemo.java"
click node_blocking_producer "https://github.com/neon010/java-demo/blob/main/ProducerConsumerBlockingQueue.java"
click node_blocking_queue "https://github.com/neon010/java-demo/blob/main/ProducerConsumerBlockingQueue.java"
click node_blocking_consumer "https://github.com/neon010/java-demo/blob/main/ProducerConsumerBlockingQueue.java"
click node_wait_producer "https://github.com/neon010/java-demo/blob/main/ProducerConsumerWaitNotify.java"
click node_wait_buffer "https://github.com/neon010/java-demo/blob/main/ProducerConsumerWaitNotify.java"
click node_wait_consumer "https://github.com/neon010/java-demo/blob/main/ProducerConsumerWaitNotify.java"
click node_lru "https://github.com/neon010/java-demo/blob/main/ThreadSafeLRUCache.java"
click node_frequency "https://github.com/neon010/java-demo/blob/main/FrequencyCounter.java"
click node_dedupe "https://github.com/neon010/java-demo/blob/main/RemoveDuplicate.java"
click node_employee_model "https://github.com/neon010/java-demo/blob/main/Employee.java"
click node_employee_queries "https://github.com/neon010/java-demo/blob/main/Main.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_executor,node_future_tasks,node_future_stages,node_api_agg,node_virtual_agg toneBlue
class node_bank,node_blocking_producer,node_blocking_queue,node_blocking_consumer,node_wait_producer,node_wait_buffer,node_wait_consumer toneAmber
class node_lru,node_frequency,node_dedupe toneMint
class node_employee_model,node_employee_queries toneRose
class node_runner toneIndigo
```

## Components

### Async Work

- [Executor Futures](https://github.com/neon010/java-demo/blob/main/ExecutorFutureDemo.java): `ExecutorFutureDemo.java`
- [Square Tasks](https://github.com/neon010/java-demo/blob/main/ExecutorFutureDemo.java): `ExecutorFutureDemo.java`
- [Future Stages](https://github.com/neon010/java-demo/blob/main/CompletableFutureDemo.java): `CompletableFutureDemo.java`
- [API Aggregation](https://github.com/neon010/java-demo/blob/main/ApiAggregatorDemo.java): `ApiAggregatorDemo.java`
- [Virtual Threads](https://github.com/neon010/java-demo/blob/main/VirtualThreadsAggregator.java): `VirtualThreadsAggregator.java`

### Thread Coordination

- [Account Safety](https://github.com/neon010/java-demo/blob/main/BankAccountDemo.java): `BankAccountDemo.java`
- [Queue Producer](https://github.com/neon010/java-demo/blob/main/ProducerConsumerBlockingQueue.java): `ProducerConsumerBlockingQueue.java`
- [Blocking Buffer](https://github.com/neon010/java-demo/blob/main/ProducerConsumerBlockingQueue.java): `ProducerConsumerBlockingQueue.java`
- [Queue Consumer](https://github.com/neon010/java-demo/blob/main/ProducerConsumerBlockingQueue.java): `ProducerConsumerBlockingQueue.java`
- [Wait Producer](https://github.com/neon010/java-demo/blob/main/ProducerConsumerWaitNotify.java): `ProducerConsumerWaitNotify.java`
- [Wait Buffer](https://github.com/neon010/java-demo/blob/main/ProducerConsumerWaitNotify.java): `ProducerConsumerWaitNotify.java`
- [Wait Consumer](https://github.com/neon010/java-demo/blob/main/ProducerConsumerWaitNotify.java): `ProducerConsumerWaitNotify.java`

### Collections

- [Thread-Safe LRU](https://github.com/neon010/java-demo/blob/main/ThreadSafeLRUCache.java): `ThreadSafeLRUCache.java`
- [Word Frequency](https://github.com/neon010/java-demo/blob/main/FrequencyCounter.java): `FrequencyCounter.java`
- [Duplicate Removal](https://github.com/neon010/java-demo/blob/main/RemoveDuplicate.java): `RemoveDuplicate.java`

### Employee Streams

- [Employee Model](https://github.com/neon010/java-demo/blob/main/Employee.java): `Employee.java`
- [Employee Queries](https://github.com/neon010/java-demo/blob/main/Main.java): `Main.java`

### Other components

- **Demo Runner**

## Connections

- Executor Futures → Square Tasks: submits (evidence: `ExecutorFutureDemo.java`)
- Queue Producer → Blocking Buffer: puts items (evidence: `ProducerConsumerBlockingQueue.java`)
- Queue Consumer → Blocking Buffer: takes items (evidence: `ProducerConsumerBlockingQueue.java`)
- Wait Producer → Wait Buffer: puts items (evidence: `ProducerConsumerWaitNotify.java`)
- Wait Consumer → Wait Buffer: takes items (evidence: `ProducerConsumerWaitNotify.java`)
- Employee Queries → Employee Model: creates employees (evidence: `Main.java`)
