### Question:
EquatableValueSet implements ValueSet { @Override public Object getSingleValue() { if (!isSingleValue()) { throw new IllegalStateException("EquatableValueSet does not have just a single value"); } if (nullAllowed && valueBlock.getRowCount() == 0) { return null; } FieldReader reader = valueBlock.getFieldReader(DEFAULT_COLUMN); reader.setPosition(0); return reader.readObject(); } @JsonCreator  EquatableValueSet(
            @JsonProperty("valueBlock") Block valueBlock,
            @JsonProperty("whiteList") boolean whiteList,
            @JsonProperty("nullAllowed") boolean nullAllowed); static Builder newBuilder(BlockAllocator allocator, ArrowType type, boolean isWhiteList, boolean nullAllowed); @JsonProperty("nullAllowed") @Override boolean isNullAllowed(); @JsonProperty Block getValueBlock(); @Transient @Override ArrowType getType(); @JsonProperty boolean isWhiteList(); Block getValues(); Object getValue(int pos); @Override boolean isNone(); @Override boolean isAll(); @Override boolean isSingleValue(); @Override Object getSingleValue(); @Override boolean containsValue(Marker marker); @Override boolean containsValue(Object value); @Override EquatableValueSet intersect(BlockAllocator allocator, ValueSet other); @Override EquatableValueSet union(BlockAllocator allocator, ValueSet other); @Override EquatableValueSet complement(BlockAllocator allocator); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); @Override void close(); final boolean nullAllowed; }### Answer:
@Test public void testGetSingleValue() throws Exception { assertEquals(EquatableValueSet.of(allocator, INT, 0).getSingleValue(), 0); try { EquatableValueSet.all(allocator, INT).getSingleValue(); fail(); } catch (IllegalStateException ignored) { } }