@Test public void testCanSmooshNotDeclaration() { assertThat(smoosher.canSmoosh("subroutine some_sub(arg)")).isFalse(); }
@Override public boolean canSmoosh(final String line) { if (line == null) { throw new IllegalArgumentException("Line cannot be null."); } final String normalized = line.trim().toUpperCase(Locale.US); if (!normalized.startsWith("DECLARE ")) { return false; } final int parenPos = line.indexOf('('); if (parenPos < 0) { return false; } if (line.indexOf('=') < parenPos) { return false; } return true; }
SubroutineDeclarationSmoosher implements IndexedSmoosher<String> { @Override public boolean canSmoosh(final String line) { if (line == null) { throw new IllegalArgumentException("Line cannot be null."); } final String normalized = line.trim().toUpperCase(Locale.US); if (!normalized.startsWith("DECLARE ")) { return false; } final int parenPos = line.indexOf('('); if (parenPos < 0) { return false; } if (line.indexOf('=') < parenPos) { return false; } return true; } }
SubroutineDeclarationSmoosher implements IndexedSmoosher<String> { @Override public boolean canSmoosh(final String line) { if (line == null) { throw new IllegalArgumentException("Line cannot be null."); } final String normalized = line.trim().toUpperCase(Locale.US); if (!normalized.startsWith("DECLARE ")) { return false; } final int parenPos = line.indexOf('('); if (parenPos < 0) { return false; } if (line.indexOf('=') < parenPos) { return false; } return true; }  }
SubroutineDeclarationSmoosher implements IndexedSmoosher<String> { @Override public boolean canSmoosh(final String line) { if (line == null) { throw new IllegalArgumentException("Line cannot be null."); } final String normalized = line.trim().toUpperCase(Locale.US); if (!normalized.startsWith("DECLARE ")) { return false; } final int parenPos = line.indexOf('('); if (parenPos < 0) { return false; } if (line.indexOf('=') < parenPos) { return false; } return true; }  @Override boolean canSmoosh(final String line); @Override int getEndingIndex(); @Override String smoosh(final int startingIndex, final List<String> list); }
SubroutineDeclarationSmoosher implements IndexedSmoosher<String> { @Override public boolean canSmoosh(final String line) { if (line == null) { throw new IllegalArgumentException("Line cannot be null."); } final String normalized = line.trim().toUpperCase(Locale.US); if (!normalized.startsWith("DECLARE ")) { return false; } final int parenPos = line.indexOf('('); if (parenPos < 0) { return false; } if (line.indexOf('=') < parenPos) { return false; } return true; }  @Override boolean canSmoosh(final String line); @Override int getEndingIndex(); @Override String smoosh(final int startingIndex, final List<String> list);  }