@Test public void testIsBeforeOrEqualYear() { Assert.assertTrue(EntityDateHelper.isBeforeOrEqualYear("2008-2009", 2011)); Assert.assertTrue(EntityDateHelper.isBeforeOrEqualYear("2008-2008", 2011)); Assert.assertTrue(EntityDateHelper.isBeforeOrEqualYear("2009-2008", 2011)); Assert.assertTrue(EntityDateHelper.isBeforeOrEqualYear("2009-2010", 2011)); Assert.assertTrue(EntityDateHelper.isBeforeOrEqualYear("2009-2009", 2011)); Assert.assertTrue(EntityDateHelper.isBeforeOrEqualYear("2010-2009", 2011)); Assert.assertTrue(EntityDateHelper.isBeforeOrEqualYear("2010-2011", 2011)); Assert.assertTrue(EntityDateHelper.isBeforeOrEqualYear("2010-2010", 2011)); Assert.assertFalse(EntityDateHelper.isBeforeOrEqualYear("2011-2010", 2011)); Assert.assertFalse(EntityDateHelper.isBeforeOrEqualYear("2011-2012", 2011)); Assert.assertFalse(EntityDateHelper.isBeforeOrEqualYear("2012-2011", 2011)); Assert.assertFalse(EntityDateHelper.isBeforeOrEqualYear("2012-2013", 2011)); Assert.assertFalse(EntityDateHelper.isBeforeOrEqualYear("2013-2012", 2011)); }
protected static boolean isBeforeOrEqualYear(String yearSpan, int upToYear) { int fromYear = Integer.parseInt(yearSpan.split("-")[0]); int toYear = Integer.parseInt(yearSpan.split("-")[1]); return ((upToYear >= toYear) && (upToYear > fromYear)); }
EntityDateHelper { protected static boolean isBeforeOrEqualYear(String yearSpan, int upToYear) { int fromYear = Integer.parseInt(yearSpan.split("-")[0]); int toYear = Integer.parseInt(yearSpan.split("-")[1]); return ((upToYear >= toYear) && (upToYear > fromYear)); } }
EntityDateHelper { protected static boolean isBeforeOrEqualYear(String yearSpan, int upToYear) { int fromYear = Integer.parseInt(yearSpan.split("-")[0]); int toYear = Integer.parseInt(yearSpan.split("-")[1]); return ((upToYear >= toYear) && (upToYear > fromYear)); }  }
EntityDateHelper { protected static boolean isBeforeOrEqualYear(String yearSpan, int upToYear) { int fromYear = Integer.parseInt(yearSpan.split("-")[0]); int toYear = Integer.parseInt(yearSpan.split("-")[1]); return ((upToYear >= toYear) && (upToYear > fromYear)); }  static boolean shouldExtract(Entity entity, DateTime upToDate); static String retrieveDate(Entity entity); static boolean isPastOrCurrentDate(String entityDate, DateTime upToDate, String type); }
EntityDateHelper { protected static boolean isBeforeOrEqualYear(String yearSpan, int upToYear) { int fromYear = Integer.parseInt(yearSpan.split("-")[0]); int toYear = Integer.parseInt(yearSpan.split("-")[1]); return ((upToYear >= toYear) && (upToYear > fromYear)); }  static boolean shouldExtract(Entity entity, DateTime upToDate); static String retrieveDate(Entity entity); static boolean isPastOrCurrentDate(String entityDate, DateTime upToDate, String type);  }