To improve the efficiency of a processor to work with data, cache memories are used to compensate the latency delay to access data from the main memory. But because of the installation of different caches in different processors in a shared memory architecture, makes it very difficult to maintain consistency between the cache memories of different processors. For that reason, having a cache coherency protocol is really essential in those kinds of system. There are different coherency protocols for caches to maintain consistency between different caches in a shared memory system. Few of the famous cache coherency protocols are MSI, MESI, MOSI, MOESI, MERSI, etc. In this paper, the primary focus were to study the working protocols of MESI (Modified-Exclusive-Shared-Invalid) and MOESI (ModifiedOwned-Exclusive-Shared-Invalid) cache coherency protocols by designing a simple cache simulator in java, and publish the results and research findings. The main purpose of this paper is to provide new researchers and computer science students the idea regarding how to build and implement a simulator in order to understand the novel cache coherency protocols.