TPSInfo implements Serializable { public int getTPS() { int tps = 0; if (period != 0) { tps = Math.round(transactions / period); } return tps; } TPSInfo();  TPSInfo(Date timestamp, String key, int transactions, int period); TPSInfo add(TPSInfo toAdd); Date getTimestamp(); String getKey(); int getTransactions(); int getPeriodInSeconds(); int getTPS(); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode();  }
@Test public void testGetTPS_1() throws Exception { TPSInfo fixture = new TPSInfo(new Date(), "", 1, 1); int result = fixture.getTPS(); assertEquals(1, result); }
@Test public void testGetTPS_2() throws Exception { TPSInfo fixture = new TPSInfo(new Date(), "", 1, 0); int result = fixture.getTPS(); assertEquals(0, result); }