TriggerTime extends Trigger { @Override public String toJSON() { JSONObject object = new JSONObject(); JSONObject data = new JSONObject(); try { data.put("runAt", runAt); data.put("lastRun", lastRun); object.put("type", TriggerTime.class.getName()); object.put("data", data); } catch (JSONException e) { log.error("Unhandled exception", e); } return object.toString(); } TriggerTime(); private  TriggerTime(TriggerTime triggerTime); @Override boolean shouldRun(); @Override String toJSON(); @Override int friendlyName(); @Override String friendlyDescription(); @Override Optional<Integer> icon(); @Override Trigger duplicate(); @Override void generateDialog(LinearLayout root, FragmentManager fragmentManager);  }
@Test public void toJSONTest() { TriggerTime t = new TriggerTime().runAt(now - T.mins(1).msecs()); Assert.assertEquals(timeJson, t.toJSON()); }