@Test(expected = IllegalArgumentException.class) public void testSettingLessThanMinShouldThrowException() { List<WaypointEntry> entryList = new ArrayList<>(); final WaypointEntry entry = MockUtils.mockWayPointEntry(); entryList.add(entry); mWaypointList.setEntries(entryList); }
public void setEntries(final List<WaypointEntry> entries) { if (entries.size() > mMaxWaypointCount) { throw new IllegalArgumentException( getContext().getString(R.string.msdkui_exception_waypoint_exceed_max)); } if (entries.size() < mMinWaypointCount) { throw new IllegalArgumentException( getContext().getString(R.string.msdkui_exception_waypoint_failing_min)); } mWaypointEntries.clear(); mWaypointEntries.addAll(entries); mAdapter.updateEntry(); }
WaypointList extends RecyclerView { public void setEntries(final List<WaypointEntry> entries) { if (entries.size() > mMaxWaypointCount) { throw new IllegalArgumentException( getContext().getString(R.string.msdkui_exception_waypoint_exceed_max)); } if (entries.size() < mMinWaypointCount) { throw new IllegalArgumentException( getContext().getString(R.string.msdkui_exception_waypoint_failing_min)); } mWaypointEntries.clear(); mWaypointEntries.addAll(entries); mAdapter.updateEntry(); } }
WaypointList extends RecyclerView { public void setEntries(final List<WaypointEntry> entries) { if (entries.size() > mMaxWaypointCount) { throw new IllegalArgumentException( getContext().getString(R.string.msdkui_exception_waypoint_exceed_max)); } if (entries.size() < mMinWaypointCount) { throw new IllegalArgumentException( getContext().getString(R.string.msdkui_exception_waypoint_failing_min)); } mWaypointEntries.clear(); mWaypointEntries.addAll(entries); mAdapter.updateEntry(); } WaypointList(final Context context);  WaypointList(final Context context, final AttributeSet attrs);  WaypointList(final Context context, final AttributeSet attrs, final int defStyleAttr); }
WaypointList extends RecyclerView { public void setEntries(final List<WaypointEntry> entries) { if (entries.size() > mMaxWaypointCount) { throw new IllegalArgumentException( getContext().getString(R.string.msdkui_exception_waypoint_exceed_max)); } if (entries.size() < mMinWaypointCount) { throw new IllegalArgumentException( getContext().getString(R.string.msdkui_exception_waypoint_failing_min)); } mWaypointEntries.clear(); mWaypointEntries.addAll(entries); mAdapter.updateEntry(); } WaypointList(final Context context);  WaypointList(final Context context, final AttributeSet attrs);  WaypointList(final Context context, final AttributeSet attrs, final int defStyleAttr); final WaypointEntry addEmptyEntry(); final WaypointEntry insertEmptyEntry(final int index); final boolean addEntry(final WaypointEntry entry); void insertEntry(final int index, final WaypointEntry entry); void updateEntry(final int index, final WaypointEntry entry); WaypointEntry removeEntry(final int index); int getMinWaypointItems(); void setMinWaypointItems(final int count); void setMaxWaypointItems(final int count); int getMaxWaypointItems(); void setVisibleNumberOfWaypointItems(final int count); int getVisibleWaypointItems(); void reset(); void reverse(); List<WaypointEntry> getEntries(); void setEntries(final List<WaypointEntry> entries); List<RouteWaypoint> getRouteWaypoints(); int getEntriesCount(); void setListener(final WaypointList.Listener listener); }
WaypointList extends RecyclerView { public void setEntries(final List<WaypointEntry> entries) { if (entries.size() > mMaxWaypointCount) { throw new IllegalArgumentException( getContext().getString(R.string.msdkui_exception_waypoint_exceed_max)); } if (entries.size() < mMinWaypointCount) { throw new IllegalArgumentException( getContext().getString(R.string.msdkui_exception_waypoint_failing_min)); } mWaypointEntries.clear(); mWaypointEntries.addAll(entries); mAdapter.updateEntry(); } WaypointList(final Context context);  WaypointList(final Context context, final AttributeSet attrs);  WaypointList(final Context context, final AttributeSet attrs, final int defStyleAttr); final WaypointEntry addEmptyEntry(); final WaypointEntry insertEmptyEntry(final int index); final boolean addEntry(final WaypointEntry entry); void insertEntry(final int index, final WaypointEntry entry); void updateEntry(final int index, final WaypointEntry entry); WaypointEntry removeEntry(final int index); int getMinWaypointItems(); void setMinWaypointItems(final int count); void setMaxWaypointItems(final int count); int getMaxWaypointItems(); void setVisibleNumberOfWaypointItems(final int count); int getVisibleWaypointItems(); void reset(); void reverse(); List<WaypointEntry> getEntries(); void setEntries(final List<WaypointEntry> entries); List<RouteWaypoint> getRouteWaypoints(); int getEntriesCount(); void setListener(final WaypointList.Listener listener);  }