@Test public void filter() { List<Object> objects = new ArrayList<Object>(); objects.add(comparable); objects.add(comparable); doReturn(0).doReturn(1).when(comparable).compareTo(any()); doReturn(comparable).when(gtetFilter).getAttributeValue(comparable); List<Object> actualObjects = gtetFilter.filter(objects); assertEquals(comparable, actualObjects.get(0)); assertEquals(comparable, actualObjects.get(1)); }
@SuppressWarnings({"unchecked", "rawtypes"}) public List<Object> filter(final List<Object> objects) { final List<Object> result = new ArrayList<Object>(); for (final Object object : objects) { final Comparable objectValue = (Comparable) getAttributeValue(object); if (objectValue.compareTo(value) >= 0) { result.add(object); } } return result; }
GTETFilter extends ArithmeticFilter { @SuppressWarnings({"unchecked", "rawtypes"}) public List<Object> filter(final List<Object> objects) { final List<Object> result = new ArrayList<Object>(); for (final Object object : objects) { final Comparable objectValue = (Comparable) getAttributeValue(object); if (objectValue.compareTo(value) >= 0) { result.add(object); } } return result; } }
GTETFilter extends ArithmeticFilter { @SuppressWarnings({"unchecked", "rawtypes"}) public List<Object> filter(final List<Object> objects) { final List<Object> result = new ArrayList<Object>(); for (final Object object : objects) { final Comparable objectValue = (Comparable) getAttributeValue(object); if (objectValue.compareTo(value) >= 0) { result.add(object); } } return result; } GTETFilter(String attributeName, Object value); }
GTETFilter extends ArithmeticFilter { @SuppressWarnings({"unchecked", "rawtypes"}) public List<Object> filter(final List<Object> objects) { final List<Object> result = new ArrayList<Object>(); for (final Object object : objects) { final Comparable objectValue = (Comparable) getAttributeValue(object); if (objectValue.compareTo(value) >= 0) { result.add(object); } } return result; } GTETFilter(String attributeName, Object value); @SuppressWarnings({"unchecked", "rawtypes"}) List<Object> filter(final List<Object> objects); }
GTETFilter extends ArithmeticFilter { @SuppressWarnings({"unchecked", "rawtypes"}) public List<Object> filter(final List<Object> objects) { final List<Object> result = new ArrayList<Object>(); for (final Object object : objects) { final Comparable objectValue = (Comparable) getAttributeValue(object); if (objectValue.compareTo(value) >= 0) { result.add(object); } } return result; } GTETFilter(String attributeName, Object value); @SuppressWarnings({"unchecked", "rawtypes"}) List<Object> filter(final List<Object> objects);  }