class KafkaOffsetManager implements AutoCloseable {

    public void setOffsets(Map<TopicAndPartition, Long> offsets) throws IllegalArgumentException {

        if (MapUtils.isEmpty(offsets)) {
            throw new IllegalArgumentException("Offsets map can't be null or empty");
        }
        if (!KafkaOffsetManagerUtils.isValidOffsetMap(offsets)) {
            throw new IllegalArgumentException("Invalid offsets Map<TopicAndPartition, Long>");
        }
        dao.setOffsets(groupid, offsets);
    }

}

class KafkaOffsetManagerTest {

    private static Logger Log;
    private KafkaOffsetManager validKOM;
    private IOffsetDao dao;
    private List<String> topicList;
    @ClassRule
    public static KafkaJunitRule kafkaRule;

    @Test(expected = IllegalArgumentException.class)
    public void testSetWithInvalidParams() throws Exception {


        validKOM.setOffsets(null);
    }

}