@Test public void testCanSmoosh() { assertThat(smoosher.canSmoosh("subroutine some_sub(null)")).isTrue(); assertThat(smoosher.canSmoosh("declare some_var = i2")).isFalse(); }
@Override public boolean canSmoosh(final String line) { if (line == null) { throw new IllegalArgumentException("Line cannot be null."); } return line.toUpperCase(Locale.US).trim().startsWith("SUBROUTINE "); }
SubroutineDefinitionHeaderSmoosher implements IndexedSmoosher<String> { @Override public boolean canSmoosh(final String line) { if (line == null) { throw new IllegalArgumentException("Line cannot be null."); } return line.toUpperCase(Locale.US).trim().startsWith("SUBROUTINE "); } }
SubroutineDefinitionHeaderSmoosher implements IndexedSmoosher<String> { @Override public boolean canSmoosh(final String line) { if (line == null) { throw new IllegalArgumentException("Line cannot be null."); } return line.toUpperCase(Locale.US).trim().startsWith("SUBROUTINE "); }  }
SubroutineDefinitionHeaderSmoosher implements IndexedSmoosher<String> { @Override public boolean canSmoosh(final String line) { if (line == null) { throw new IllegalArgumentException("Line cannot be null."); } return line.toUpperCase(Locale.US).trim().startsWith("SUBROUTINE "); }  @Override boolean canSmoosh(final String line); @Override int getEndingIndex(); @Override String smoosh(final int startingIndex, final List<String> list); }
SubroutineDefinitionHeaderSmoosher implements IndexedSmoosher<String> { @Override public boolean canSmoosh(final String line) { if (line == null) { throw new IllegalArgumentException("Line cannot be null."); } return line.toUpperCase(Locale.US).trim().startsWith("SUBROUTINE "); }  @Override boolean canSmoosh(final String line); @Override int getEndingIndex(); @Override String smoosh(final int startingIndex, final List<String> list);  }