class StartedKamonTimer implements StartedTimer {

    @Override
    public StoppedTimer stop() {

        if (isRunning()) {
            stopped = true;
            return StoppedKamonTimer.fromStartedTimer(this);
        }

        throw new IllegalStateException(
                String.format("Tried to stop the already stopped timer <%s> with segment <%s>.", name,
                        getTag(SEGMENT_TAG)));
    }

    private  StartedKamonTimer(final String name, final Map<String, String> tags);

}