Initial unit tests

this super complex behavior depending on passed parameter just lead me to idea, that we should create simple Interval object, that handle such processing and unify it somehow.