GuidanceManeuverUtil { public static int getIndexOfManeuver(Maneuver maneuver, List<Maneuver> maneuvers) { for (int x = 0; x < maneuvers.size(); x++) { final Maneuver tmpManeuver = maneuvers.get(x); if (maneuversEqual(maneuver, tmpManeuver)) { return x; } } return -1; } private  GuidanceManeuverUtil(); static int getIndexOfManeuver(Maneuver maneuver, List<Maneuver> maneuvers); static boolean maneuversEqual(Maneuver maneuverA, Maneuver maneuverB); static String getCurrentManeuverStreet(@NonNull Context context, @NonNull Maneuver maneuver); static String determineNextManeuverStreet(Context context, Maneuver maneuver,
            BaseGuidancePresenter baseGuidancePresenter);  }
@Test public void testGetIndexOfManeuver() { final Maneuver maneuver = MockUtils.mockManeuver(); final Maneuver maneuver1 = MockUtils.mockManeuver(); final GeoCoordinate coordinate = MockUtils.mockGeoCoordinate(1, 1); final GeoCoordinate coordinate1 = MockUtils.mockGeoCoordinate(2, 2); when(maneuver.getCoordinate()).thenReturn(coordinate); when(maneuver1.getCoordinate()).thenReturn(coordinate1); int index = GuidanceManeuverUtil.getIndexOfManeuver(maneuver, new ArrayList<>(Arrays.asList(maneuver, maneuver1))); assertThat(index, is(0)); index = GuidanceManeuverUtil.getIndexOfManeuver(maneuver, new ArrayList<>(Collections.singletonList(maneuver1))); assertThat(index, is(-1)); }