@SuppressWarnings("unchecked")
    public static void validateFormat(Object offsetData) {
        if (offsetData == null)
            return;

        if (!(offsetData instanceof Map))
            throw new DataException("Offsets must be specified as a Map");
        validateFormat((Map<Object, Object>) offsetData);
    }
@Test
    public void testValidateFormatMapWithNonPrimitiveKeys() {
        Map<Object, Object> offsetData = Collections.singletonMap("key", new Object());
        DataException e = assertThrows(DataException.class, () -> OffsetUtils.validateFormat(offsetData));
        assertThat(e.getMessage(), containsString("Offsets may only contain primitive types as values"));

        Map<Object, Object> offsetData2 = Collections.singletonMap("key", new ArrayList<>());
        e = assertThrows(DataException.class, () -> OffsetUtils.validateFormat(offsetData2));
        assertThat(e.getMessage(), containsString("Offsets may only contain primitive types as values"));
    }