### Question:
Path { public String getPath(final Object... objects){ final List<String> pathSegments = getPathSegments(objects); return TextUtils.join("/", pathSegments); } Path(final String path);  Path(final String... pathSegments); int getPathSegmentCount(); String getMatcherPath(); List<String> getPathSegments(final Object... objects); String getPath(final Object... objects); @Override boolean equals(final Object object); boolean matches(final Uri uri);  }### Answer:
@Test public void whenUsingListGetPathWithNumbers_returnsPathWithNumbers() { final Path path = new Path("EMIR1", "#", "EMIR2", "#"); final String pathWithValues = path.getPath(4, 4.0); assertThat(pathWithValues).isEqualTo("EMIR1/4/EMIR2/4.0"); }
@Test public void whenUsingStringGetPathWithNumbers_returnsPathWithNumbers() { final Path path = new Path("EMIR1/#/EMIR2/#"); final String pathWithValues = path.getPath(4, 4.0); assertThat(pathWithValues).isEqualTo("EMIR1/4/EMIR2/4.0"); }
@Test public void whenUsingStringGetPathWithStrings_returnsPathWithStrings() { final Path path = new Path("EMIR1/*/EMIR2/*"); final String pathWithValues = path.getPath("A", "B"); assertThat(pathWithValues).isEqualTo("EMIR1/A/EMIR2/B"); }
@Test public void getPathWithStringWhenShouldBeNumeric_throwsException() { final Path path = new Path("EMIR1/#/EMIR2"); try { path.getPath("EMIR"); fail("Parsed 'EMIR' into Numeric when exception should have been thrown."); } catch (final IllegalArgumentException illegalArgumentException) { assertThat(illegalArgumentException).hasMessage("Expecting numeric value, cannot insert EMIR into '#'."); } }
@Test public void passingMoreValuesThanBindingsThrowsException() { final Path path = new Path("EMIR1/EMIR2/*"); try { path.getPath("EMIR", "EMIR"); fail("Allowed empty value for star."); } catch (final IllegalArgumentException illegalArgumentException) { assertThat(illegalArgumentException).hasMessage("Incoming values does not match number of bindings."); } }