Feature { public Date getLastUpdate() { return mLastUpdate; } Feature(@NonNull String name,@NonNull Node n,@NonNull Field dataDesc[]); void addFeatureListener(FeatureListener listener); void removeFeatureListener(FeatureListener listener); void addFeatureLoggerListener(FeatureLoggerListener logger); void removeFeatureLoggerListener(FeatureLoggerListener logger); Date getLastUpdate(); String getName(); Node getParentNode(); boolean isEnabled(); @NonNull Field[] getFieldsDesc(); @Nullable Sample getSample(); void enableNotification(); void read(); void disableNotification(); @Override String toString();  }
@Test public void getLastUpdate(){ final long UPDATE_TIME_DIFF=1000; EmptyFeatureTest f = new EmptyFeatureTest(); int timestamp = 1000; byte[] data = new byte[]{10,4}; Date now = new Date(); f.update(timestamp, data, 0); Date updateTime = f.getLastUpdate(); long diff = Math.abs(now.getTime()-updateTime.getTime()); Assert.assertTrue(diff < UPDATE_TIME_DIFF); }