@Test
public void testFindEntities() throws Exception {

    final List<Criteria.Field> fr = new ArrayList<>();
    fr.add(new CriteriaImpl.FieldImpl("ruleId", "1"));
    fr.add(new CriteriaImpl.FieldImpl("status", "NEW"));
    final Map<byte[], byte[]> tsMap = new TreeMap<>(new Bytes.ByteArrayComparator());
    tsMap.put("1444042473518".getBytes(), "1".getBytes());
    final Map<byte[], byte[]> niMap = new TreeMap<>(new Bytes.ByteArrayComparator());
    niMap.put("nid".getBytes(), "1".getBytes());
    final List<Result> results = Arrays.asList(mockResult);
    new Expectations() {
        {
            mockCriteria.clazz(); times = 1;
            result = Notification.class;
            mockCriteria.fieldRestrictions(); times = 1;
            result = fr;
            mockHTable.getScanner(withAny(new Scan())); times = 1;
            result = mockResultScanner;
            mockResultScanner.iterator();
            result = results.iterator();
            mockResult.getFamilyMap("ni".getBytes()); times = 1;
            result = niMap;
            mockResult.getValue("s".getBytes(), "qs".getBytes()); times = 1;
            result = "NEW".getBytes();
            mockResult.getFamilyMap("ts".getBytes()); times = 1;
            result = tsMap;
        }
    };
    List<Notification> notifications = notificationStore.findEntities(mockCriteria);
    System.out.println(notifications);
    assertEquals("nid", notifications.get(0).getId());
    assertEquals(Notification.Status.NEW, notifications.get(0).getStatus());
    assertEquals(1444042473518L, notifications.get(0).getTs());
    new Verifications() {
        {
            Scan scan;
            mockHTable.getScanner(scan = withCapture()); times = 1;
            System.out.println("Scan = " + scan);
        }
    };
}