ArcpRuntime.Builder.features and ArcpClient.Builder.features both call EnumSet.copyOf(features), at arcp-runtime/src/main/java/dev/arcp/runtime/ArcpRuntime.java line 247 and arcp-client/src/main/java/dev/arcp/client/ArcpClient.java line 539. EnumSet.copyOf(Collection) throws IllegalArgumentException for an empty non-EnumSet collection because it cannot infer the enum type. A caller should be able to advertise no optional features by passing Set.of(), but that currently crashes during configuration.
Fix prompt: Add a small helper that returns EnumSet.noneOf(Feature.class) when the supplied feature set is empty and EnumSet.copyOf(features) otherwise. Use it in both builders and anywhere else feature collections are copied into EnumSet. Add unit tests for ArcpRuntime.builder().features(Set.of()).build() and ArcpClient.builder(transport).features(Set.of()).build(), verifying the resulting advertised or requested capabilities are empty rather than throwing.
ArcpRuntime.Builder.features and ArcpClient.Builder.features both call EnumSet.copyOf(features), at arcp-runtime/src/main/java/dev/arcp/runtime/ArcpRuntime.java line 247 and arcp-client/src/main/java/dev/arcp/client/ArcpClient.java line 539. EnumSet.copyOf(Collection) throws IllegalArgumentException for an empty non-EnumSet collection because it cannot infer the enum type. A caller should be able to advertise no optional features by passing Set.of(), but that currently crashes during configuration.
Fix prompt: Add a small helper that returns EnumSet.noneOf(Feature.class) when the supplied feature set is empty and EnumSet.copyOf(features) otherwise. Use it in both builders and anywhere else feature collections are copied into EnumSet. Add unit tests for ArcpRuntime.builder().features(Set.of()).build() and ArcpClient.builder(transport).features(Set.of()).build(), verifying the resulting advertised or requested capabilities are empty rather than throwing.