/** Check isStale */
  public static void testIsStale() throws Exception {
    Workspace ws = Workspace.getWorkspace(new File("test/ws"));
    ws.setOffline(false);
    Project top = ws.getProject("p-stale");
    assertNotNull(top);
    top.build();
    Project bottom = ws.getProject("p-stale-dep");
    assertNotNull(bottom);
    bottom.build();

    long lastModified = bottom.lastModified();
    top.getPropertiesFile().setLastModified(lastModified + 1000);

    stale(top, true);
    stale(bottom, true);
    assertTrue(top.isStale());
    assertTrue(bottom.isStale());

    stale(top, false);
    stale(bottom, true);
    assertTrue(top.isStale());
    assertTrue(bottom.isStale());

    stale(top, true);
    stale(bottom, false);
    assertTrue(top.isStale());
    assertFalse(bottom.isStale());

    // Thread.sleep(1000);
    // stale(top, false);
    // stale(bottom, false);
    // assertFalse(top.isStale());
    // assertFalse(bottom.isStale());
  }
 private static void stale(Project project, boolean b) throws Exception {
   File file = project.getBuildFiles(false)[0];
   if (b) file.setLastModified(project.lastModified() - 10000);
   else file.setLastModified(project.lastModified() + 10000);
 }